home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / P.055 < prev    next >
Internet Message Format  |  1987-11-21  |  4KB

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