home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man3 / ctime.3 < prev    next >
Encoding:
Text File  |  1975-06-26  |  1.8 KB  |  100 lines

  1. .th CTIME III 10/15/73
  2. .sh NAME
  3. ctime, localtime, gmtime  \*-  convert date and time to ASCII
  4. .sh SYNOPSIS
  5. .ft B
  6. char *ctime(tvec)
  7. .br
  8. int tvec[2];
  9. .s3
  10. .ft R
  11. [from Fortran]
  12. .br
  13. .ft B
  14. double precision ctime
  15. .br
  16. .li
  17. ... = ctime(dummy)
  18. .s3
  19. int *localtime(tvec)
  20. .br
  21. int tvec[2];
  22. .s3
  23. int *gmtime(tvec)
  24. .br
  25. int tvec[2];
  26. .br
  27. .ft R
  28. .sh DESCRIPTION
  29. .it Ctime
  30. converts a time in the vector
  31. .it tvec
  32. such as returned by time (II)
  33. into ASCII
  34. and returns a pointer to a
  35. character string
  36. in the form
  37. .s3
  38.     Sun Sep 16 01:03:52 1973\\n\\0
  39. .s3
  40. All the fields have constant width.
  41. .s3
  42. The
  43. .it localtime
  44. and
  45. .it gmtime
  46. entries return pointers to integer vectors containing
  47. the broken-down time.
  48. .it Localtime
  49. corrects for the time zone and possible daylight savings time;
  50. .it gmtime
  51. converts directly to GMT, which is the time UNIX uses.
  52. The value is a pointer
  53. to an array whose components are
  54. .s3
  55. .lp +5 5
  56. 0    seconds
  57. .lp +5 5
  58. 1    minutes
  59. .lp +5 5
  60. 2    hours
  61. .lp +5 5
  62. 3    day of the month (1-31)
  63. .lp +5 5
  64. 4    month (0-11)
  65. .lp +5 5
  66. 5    year \*- 1900
  67. .lp +5 5
  68. 6    day of the week (Sunday = 0)
  69. .lp +5 5
  70. 7    day of the year (0-365)
  71. .lp +5 5
  72. 8    Daylight Saving Time flag if non-zero
  73. .i0
  74. .s3
  75. The external variable
  76. .it timezone
  77. contains the difference, in seconds, between GMT and local
  78. standard time (in EST, is 5*60*60);
  79. the external variable
  80. .it daylight
  81. is non-zero iff the standard U.S.A. Daylight
  82. Savings Time conversion should be applied.
  83. The program knows about the peculiarities
  84. of this conversion in 1974 and 1975;
  85. if necessary,
  86. a table for these years can be extended.
  87. .s3
  88. A routine named
  89. .it ctime
  90. is also available from Fortran.
  91. Actually it more resembles the
  92. .it time
  93. (II) system entry in that it returns the number of seconds
  94. since the epoch
  95. 0000 GMT Jan. 1, 1970
  96. (as a floating-point number).
  97. .sh "SEE ALSO"
  98. time(II)
  99. .sh BUGS
  100.