home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v8 / text0063.txt < prev    next >
Encoding:
Text File  |  1987-06-30  |  4.4 KB  |  130 lines

  1. [ This is a reposting of P.55, the P1003.1 Timezones proposal,
  2. due to recent interest coinciding with the meeting of P1003
  3. going on this week in Atlantic City.  -mod ]
  4.  
  5. From: std-unix%ut-sally.UUCP@sally.utexas.edu (Moderator, John Quarterman)
  6. Date: 29 Sep 86 19:14:18 GMT
  7.  
  8. There are several decisions needed regarding timezones and 1003.1:
  9.  
  10. Which proposal should be accepted (P.55 or the one forthcoming from HP)?
  11.  
  12. If P.55:
  13. Accept settz 4.5.3?
  14. Add 4.5.4 or incorporate third paragraph in 4.5.3?
  15. Details of Errors and References.
  16. Suggested Appendices:
  17.     Olsen's implementation?
  18.     List of names of timezones?
  19.  
  20. The rest of this article is the text of Proposal 55.
  21.  
  22. IEEE 1003.1 P.55:
  23.  
  24. Time Zone Proposal based on work by Robert Elz and Arthur Olsen.
  25. Submitted by John S. Quarterman.  Proposal number assigned 19 Sept. 1986.
  26.  
  27. Add 4.5.3 and 4.5.4 to the standard and perhaps also
  28. document Arthur Olsen's implementation in an Appendix.
  29.  
  30. Note that all of 4.5.4 except the last paragraph of 4.5.4.2, the last
  31. sentence of 4.5.4.3, and all of 4.5.4.4 and 4.5.4.5, is intended to
  32. track X3J11.  I.e., the purpose of 4.5.4 is to constrain ctime() and
  33. localtime() further than X3J11, not to change what X3J11 says about them.
  34.  
  35. % is used to indicate the section sign.  Italics are implied in the
  36. normal format of the POSIX document.
  37.  
  38.  
  39. 4.5.3    Set Local Time Conversion
  40. Function:  settz()
  41.  
  42. 4.5.3.1    Synopsis
  43.     int settz(p)
  44.     char *p;
  45.  
  46. 4.5.3.2    Description
  47.     The settz() function determines the conversion from GMT
  48. of the local times returned by localtime() and ctime().
  49. When called with a NULL pointer argument (p==0), settz
  50. shall select the appropriate local time conversion for the
  51. location of the host machine on which the call is executed.
  52. When called with a null string (p!=0 && *p=='\0'), settz
  53. shall select no conversion for localtime, making localtime()
  54. and gmtime() equivalent and ctime() and asctime(gmtime())
  55. equivalent.  When called with a non-null string (p!=0 && *p!='\0'),
  56. settz may set the conversion according to that string.
  57. The format of the string and the conversions it may specify
  58. are implementation specific.  If an implementation accepts
  59. non-null string arguments to settz, the implementation
  60. should allow users to define their own conversions
  61. rather than restricting conversions to a standard set.
  62. If settz is called with a string for which the implementation
  63. can not find a conversion, settz shall return -1, but the
  64. conversion it sets is implementation defined and may be one of
  65. GMT, the executing machine's local time, or local time for
  66. the area where the implementation was performed.
  67.  
  68. 4.5.3.3    Returns
  69.     Upon successful completion, settz() returns 0, otherwise -1,
  70. and errno is set to indicate the error.
  71.  
  72. 4.5.3.4  Errors
  73.     If the function returns -1 the value stored in errno may be
  74. interpreted as follows:
  75.  
  76. [EFAULT]    The argument p points outside the process's allocated
  77.     addresss space.
  78.  
  79. 4.5.3.5  References
  80. time() %4.5.1, localtime(), ctime() %4.5.4.
  81.  
  82.  
  83. 4.5.4  Get Local Time
  84. Functions:  localtime(), ctime()
  85.  
  86. 4.5.4.1  Synopsis
  87.     #include <time.h>
  88.  
  89.     struct tm *localtime(timer)
  90.     char *ctime(timer)
  91.     time_t *timer;
  92.  
  93. 4.5.4.2  Description
  94.     The localtime() function converts the calendar time pointed to
  95. by timer to local time in the form of a string.  It is equivalent to
  96.     asctime(localtime(timer))
  97.  
  98.     The local time conversion is specified by a call on settz().
  99. If localtime() or ctime() is called and settz() has not been called
  100. since the last exec(), the localtime() or ctime() call shall call
  101. settz(getenv("TZ")) before performing the local time conversion.
  102. The local time conversion should be accurate for all times
  103. from the base time of the time() function up to the time
  104. the call is made.  Future times should be converted as accurately
  105. as possible with available political information.  Daylight savings
  106. time should be taken into account in both cases.
  107.  
  108. 4.5.4.3  Returns
  109.     The localtime() function returns a pointer to that object.
  110.     The ctime() function returns the pointer returned by the
  111. asctime() function with that broken-down time as argument.
  112.     On unsuccessful completion of either function, a NULL pointer
  113. shall be returned and errno is set to indicate the error.
  114.  
  115. 4.5.4.4  Errors
  116.     If either function returns a NULL pointer the value stored in
  117. errno may be interpreted as follows:
  118.  
  119. [EFAULT]    The argument points outside the process's allocated
  120.     address space.
  121.  
  122. 4.5.4.5  References
  123. time() %4.5.1, settz() %4.5.3.
  124.  
  125. Volume-Number: Volume 7, Number 8
  126.  
  127.  
  128. Volume-Number: Volume 8, Number 64
  129.  
  130.