mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Use 64-bit years
This change makes strftime() go faster and makes it possible to format timestamps through the big bang to most of the stelliferous era. India has also been added as a timezone to most binaries. Since we were able to change the struct tm abi, this makes cosmopolitan libc superior, to just about everything else, when it comes to standing the test of time
This commit is contained in:
parent
2aebda7718
commit
cfc3a953ae
13 changed files with 542 additions and 482 deletions
|
@ -2,16 +2,24 @@
|
|||
#define COSMOPOLITAN_LIBC_TIME_STRUCT_TM_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Time component structure.
|
||||
*
|
||||
* This structure is used by gmtime() and localtime(). It's not a kernel
|
||||
* interface. We use a different ABI than most C libraries here, because
|
||||
* we want to support timestamps dating back to the big bang, as well as
|
||||
* timestamps through much of the stelliferous era.
|
||||
*/
|
||||
struct tm {
|
||||
int32_t tm_sec;
|
||||
int32_t tm_min;
|
||||
int32_t tm_hour;
|
||||
int32_t tm_mday; /* 1-indexed */
|
||||
int32_t tm_mon; /* 0-indexed */
|
||||
int32_t tm_year; /* minus 1900 */
|
||||
int32_t tm_wday;
|
||||
int32_t tm_yday;
|
||||
int32_t tm_isdst;
|
||||
int64_t tm_year; /* minus 1900 */
|
||||
int64_t tm_mon; /* 0-indexed */
|
||||
int64_t tm_mday; /* 1-indexed */
|
||||
int64_t tm_hour;
|
||||
int64_t tm_min;
|
||||
int64_t tm_sec;
|
||||
int64_t tm_wday;
|
||||
int64_t tm_yday;
|
||||
int64_t tm_isdst;
|
||||
int64_t tm_gmtoff;
|
||||
const char *tm_zone;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue