10 digit unix time stamp
2007-12-24 19:07:00
The 'changeover' happening on 9th September will be from:
(binary)
111011100110101100100111111111 seconds to :
111011100110101100101000000000 seconds
..which doesn't look threatening!
The change from 9 to 10 digits happens only if you convert these numbers to
denary/base-10, and would only then be a problem if you tried to store the
number in a data type which could only handle a 9 digit denary number. I'm not
aware of many languages which would allow this - COBOL maybe?
Since Solaris, and most (all?) other UNIX implementations are written in C which
firstly doesn't work in denary/base-10 - and secondly doesn't even have a
denary/base-10 type, we won't have a problem.
Here's a little proof:
#include <sys/types.h>
#include <time.h>
main()
{
time_t timet;
timet=999999999L;
printf("last second before rollover: %s",asctime(gmtime(&timet)));
timet++;
printf("first second after rollover: %s",asctime(gmtime(&timet)));
}
which yields:
last second before rollover: Sun Sep 9 01:46:39 2001
first second after rollover: Sun Sep 9 01:46:40 2001
So by all means tell your boss you need some overtime on 9/9/01 but don't expect
to be busy folks :-)
regards,
Justin
--
______
/_____/\ Justin Stringfellow
/____ \\ \ Support Engineer
/_____\ \\ / Sun Microsystems
/_____/ \/ / / Guillemont Park
/_____/ / \//\
\_____\//\ / / Tel. : +44 (0)870 6003222
\_____/ / /\ /
\_____/ \\ \
\_____\ \\
\_____\/
Comments
Got something to say?
You must be logged in to post a comment.

