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

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