Namespaces
Variants
Views
Actions

Talk:c/chrono/localtime

From cppreference.com
< Talk:c‎ | chrono

struct tm *localtime_s(const time_t *restrict time, struct tm *restrict result);(since C11) Are the first parameter and the second parameter reverse? Wkp (talk) 01:14, 26 January 2016 (PST)

time comes first, buffer comes second, see K.3.8.2.4 in C11 --Cubbi (talk) 03:15, 26 January 2016 (PST)

yes, thank you. I understand that i mistake it for vs's localtime_s. Wkp (talk) 19:01, 26 January 2016 (PST)

[edit] tzset()

The cited POSIX source, The Open Group Base Specifications Issue 7, 2018 edition, seem to contradict the article:

Unlike localtime(), the localtime_r() function is not required to set tzname. If localtime_r() sets tzname, it shall also set daylight and timezone. If localtime_r() does not set tzname, it shall not set daylight and shall not set timezone. [Option End]

--Johan Boule (talk) 13:53, 13 December 2020 (PST) <-- And yes, this PST timezone does not correspond to mine.

the sentence we're referencing is "Local timezone information is used as though localtime() calls tzset()." I suppose we could just mention localtime in that sentence. --Cubbi (talk) 20:00, 13 December 2020 (PST)