bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

time64: 64-bit variants of gmtime, mktime, localtime etc?


From: Simon Josefsson
Subject: time64: 64-bit variants of gmtime, mktime, localtime etc?
Date: Wed, 07 Mar 2007 16:56:05 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.94 (gnu/linux)

What do people think about to offer a new set of modules that use
64-bit integers for time representation?

I'm thinking a time64.h:

#include <stdint.h>
typedef int64_t time64_t;
struct tm *gmtime_r(const time64_t *timep, struct tm *result);
struct tm *localtime_r(const time64_t *timep, struct tm *result);
time64_t mktime(struct tm *tm);

With this module, packages that need support for years >2038 can use
do this now, instead of waiting for time_t to be made larger in the
compiler/OS they use.

(This opens up for a time128_t if someone is bothered by the
292471210647 year problem inherent with 64-bit times...)

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]