newstrftime.3 (46c599340f187db577b9212ab18022f3c7380c68) | newstrftime.3 (a979394afeb5c20fc58c5f5b005d51eb8f92f666) |
---|---|
1.\" strftime man page 2.\" 3.\" Based on the UCB file whose corrected copyright information appears below. 4.\" Copyright 1989, 1991 The Regents of the University of California. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" the American National Standards Committee X3, on Information --- 77 unchanged lines hidden (view full) --- 86Each conversion specification is replaced by the characters as 87follows which are then copied into the array. 88The characters depend on the values of zero or more members of 89.BI * timeptr 90as specified by brackets in the description. 91If a bracketed member name is followed by 92.q + , 93.B strftime | 1.\" strftime man page 2.\" 3.\" Based on the UCB file whose corrected copyright information appears below. 4.\" Copyright 1989, 1991 The Regents of the University of California. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" the American National Standards Committee X3, on Information --- 77 unchanged lines hidden (view full) --- 86Each conversion specification is replaced by the characters as 87follows which are then copied into the array. 88The characters depend on the values of zero or more members of 89.BI * timeptr 90as specified by brackets in the description. 91If a bracketed member name is followed by 92.q + , 93.B strftime |
94can use the named member even though POSIX.1-2017 does not list it; | 94can use the named member even though POSIX.1-2024 does not list it; |
95if the name is followed by 96.q \*- , 97.B strftime | 95if the name is followed by 96.q \*- , 97.B strftime |
98ignores the member even though POSIX.1-2017 lists it | 98ignores the member even though POSIX.1-2024 lists it |
99which means portable code should set it. 100For portability, 101.BI * timeptr 102should be initialized as if by a successful call to 103.BR gmtime , 104.BR localtime , 105.BR mktime , 106.BR timegm , --- 25 unchanged lines hidden (view full) --- 132.RI [ tm_year , 133.IR tm_yday , 134.IR tm_mon , 135.IR tm_mday , 136.IR tm_wday , 137.IR tm_hour , 138.IR tm_min , 139.IR tm_sec , | 99which means portable code should set it. 100For portability, 101.BI * timeptr 102should be initialized as if by a successful call to 103.BR gmtime , 104.BR localtime , 105.BR mktime , 106.BR timegm , --- 25 unchanged lines hidden (view full) --- 132.RI [ tm_year , 133.IR tm_yday , 134.IR tm_mon , 135.IR tm_mday , 136.IR tm_wday , 137.IR tm_hour , 138.IR tm_min , 139.IR tm_sec , |
140.IR tm_gmtoff +, 141.IR tm_zone +, | 140.IR tm_gmtoff , 141.IR tm_zone , |
142.IR tm_isdst \*-]. 143.TP 144%D 145is equivalent to 146.c %m/%d/%y . 147.RI [ tm_year , 148.IR tm_mon , 149.IR tm_mday ] --- 171 unchanged lines hidden (view full) --- 321.RI [ tm_year \*-, 322.IR tm_yday \*-, 323.IR tm_mon \*-, 324.IR tm_mday \*-, 325.IR tm_wday \*-, 326.IR tm_hour , 327.IR tm_min , 328.IR tm_sec , | 142.IR tm_isdst \*-]. 143.TP 144%D 145is equivalent to 146.c %m/%d/%y . 147.RI [ tm_year , 148.IR tm_mon , 149.IR tm_mday ] --- 171 unchanged lines hidden (view full) --- 321.RI [ tm_year \*-, 322.IR tm_yday \*-, 323.IR tm_mon \*-, 324.IR tm_mday \*-, 325.IR tm_wday \*-, 326.IR tm_hour , 327.IR tm_min , 328.IR tm_sec , |
329.IR tm_gmtoff +, 330.IR tm_zone +, | 329.IR tm_gmtoff , 330.IR tm_zone , |
331.IR tm_isdst \*-]. 332.TP 333%x 334is replaced by the locale's appropriate date representation. 335.RI [ tm_year , 336.IR tm_yday , 337.IR tm_mon , 338.IR tm_mday , --- 11 unchanged lines hidden (view full) --- 350.TP 351%y 352is replaced by the year without century as a decimal number [00,99]. 353.RI [ tm_year ] 354.TP 355%Z 356is replaced by the time zone abbreviation, 357or by the empty string if this is not determinable. | 331.IR tm_isdst \*-]. 332.TP 333%x 334is replaced by the locale's appropriate date representation. 335.RI [ tm_year , 336.IR tm_yday , 337.IR tm_mon , 338.IR tm_mday , --- 11 unchanged lines hidden (view full) --- 350.TP 351%y 352is replaced by the year without century as a decimal number [00,99]. 353.RI [ tm_year ] 354.TP 355%Z 356is replaced by the time zone abbreviation, 357or by the empty string if this is not determinable. |
358.RI [ tm_zone +, | 358.RI [ tm_zone , |
359.IR tm_isdst \*-] 360.TP 361%z 362is replaced by the offset from the Prime Meridian 363in the format +HHMM or \*-HHMM (ISO 8601) as appropriate, 364with positive values representing locations east of Greenwich, 365or by the empty string if this is not determinable. 366The numeric time zone abbreviation \*-0000 is used when the time is 367Universal Time 368but local time is indeterminate; by convention this is used for 369locations while uninhabited, and corresponds to a zero offset when the 370time zone abbreviation begins with 371.q "\*-" . | 359.IR tm_isdst \*-] 360.TP 361%z 362is replaced by the offset from the Prime Meridian 363in the format +HHMM or \*-HHMM (ISO 8601) as appropriate, 364with positive values representing locations east of Greenwich, 365or by the empty string if this is not determinable. 366The numeric time zone abbreviation \*-0000 is used when the time is 367Universal Time 368but local time is indeterminate; by convention this is used for 369locations while uninhabited, and corresponds to a zero offset when the 370time zone abbreviation begins with 371.q "\*-" . |
372.RI [ tm_gmtoff +, | 372.RI [ tm_gmtoff , |
373.IR tm_zone +, 374.IR tm_isdst \*-] 375.TP 376%% 377is replaced by a single %. 378.TP 379%+ 380is replaced by the locale's date and time in --- 12 unchanged lines hidden (view full) --- 393.PP 394As a side effect, 395.B strftime 396also behaves as if 397.B tzset 398were called. 399This is for compatibility with older platforms, as required by POSIX; 400it is not needed for | 373.IR tm_zone +, 374.IR tm_isdst \*-] 375.TP 376%% 377is replaced by a single %. 378.TP 379%+ 380is replaced by the locale's date and time in --- 12 unchanged lines hidden (view full) --- 393.PP 394As a side effect, 395.B strftime 396also behaves as if 397.B tzset 398were called. 399This is for compatibility with older platforms, as required by POSIX; 400it is not needed for |
401.BR tzset 's | 401.BR strftime 's |
402own use. 403.SH "RETURN VALUE" 404If the conversion is successful, 405.B strftime 406returns the number of bytes placed into the array, not counting the 407terminating NUL; 408.B errno 409is unchanged if the returned value is zero. --- 13 unchanged lines hidden (view full) --- 423.TP 424[EOVERFLOW] 425The format includes an 426.c %s 427conversion and the number of seconds since the Epoch cannot be represented 428in a 429.c time_t . 430.SH SEE ALSO | 402own use. 403.SH "RETURN VALUE" 404If the conversion is successful, 405.B strftime 406returns the number of bytes placed into the array, not counting the 407terminating NUL; 408.B errno 409is unchanged if the returned value is zero. --- 13 unchanged lines hidden (view full) --- 423.TP 424[EOVERFLOW] 425The format includes an 426.c %s 427conversion and the number of seconds since the Epoch cannot be represented 428in a 429.c time_t . 430.SH SEE ALSO |
431date(1), 432getenv(3), 433newctime(3), 434newtzset(3), 435time(2), 436tzfile(5) | 431.BR date (1), 432.BR getenv (3), 433.BR newctime (3), 434.BR newtzset (3), 435.BR time (2), 436.BR tzfile (5). |
437.SH BUGS 438There is no conversion specification for the phase of the moon. | 437.SH BUGS 438There is no conversion specification for the phase of the moon. |