|
From: Rick C. <Ric...@bu...> - 2006-05-31 00:23:41
|
If I substitute
DateTime utcEpoch =3D new DateTime(1970,1,1);
for the first line in George's example, the output is
---- Console output ---
The UTC epoch is 621355968000000000 ticks
The .Net epoch is 0 ticks
The difference in DateTime is 719162.00:00:00 (621355968000000000 ticks) =
-------------------------------
It would appear that .NET agrees with your calculation, Markus.
Cheers
- rick
-----Original Message-----
From: icu...@li... =
[mailto:icu...@li...] On Behalf Of George =
Rhoten
Sent: Tuesday, 30 May 2006 16:20
To: icu...@li...
Subject: Re: [icu-support] Universal Time Scale: Julian vs. Gregorian =
until 1582?
Here is what the following code in C# says.
DateTime utcEpoch =3D DateTime.FromFileTimeUtc(0);
DateTime netEpoch =3D DateTime.MinValue;
TimeSpan diffEpoch =3D utcEpoch - netEpoch;
/* Each tick is a 100-nanosecond interval that have elapsed since 12:00=20
A.M., January 1, 0001 */
Console.WriteLine("The UTC epoch is {0} ticks", utcEpoch.Ticks);
Console.WriteLine("The .Net epoch is {0} ticks", netEpoch.Ticks);
Console.WriteLine("The difference in DateTime is {0} ({1} ticks)",=20
diffEpoch, diffEpoch.Ticks);
---- Console output ---
The UTC epoch is 504911232000000000 ticks
The .Net epoch is 0 ticks
The difference in DateTime is 584388.00:00:00 (504911232000000000 ticks)
-------------------------------
George Rhoten
IBM Globalization Center of Competency/ICU San Jos=E9, CA, USA
http://www.icu-project.org/
http://icu.sourceforge.net/
"Markus Scherer" <mar...@gm...>=20
Sent by: icu...@li...
05/30/2006 03:50 PM
Please respond to
icu...@li...
To
icu...@li...
cc
Subject
Re: [icu-support] Universal Time Scale: Julian vs. Gregorian until 1582?
I did a bit of sniffing around the ICU code and may have found a bug -
I would like someone to confirm or deny.
According to utmscale.c, there are 62135769600 seconds =3D 719164 days
between 00010101 and 19700101.
(timeScaleTable[UDTS_UNIX_TIME=3D1][UTSV_EPOCH_OFFSET_VALUE=3D1])
According to my own calculation, there are 62135596800 seconds =3D
719162 days between 00010101 and 19700101. This is two days fewer.
Someone else here confirmed my number through his own calculation,
burned into their code.
Why would ICU be two days off? How did we arrive at that constant when
we wrote the code?
Could someone please write a few lines of .Net code and tell me what
System.DateTime value they get for 1970-jan-01 00:00:00? (It should be
one or the other seconds value above, times 10^7.)
Here is my own calculation: From 00010101 to 19700101 there are
1969 years, times 365 days
plus 1968/4 leap years=3Dleap days
minus 19 centuries without leap years
plus 4 leap days every 400 years (in 400, 800, 1200, 1600)
(This uses the proleptic Gregorian calendar.)
Thanks,
markus
--=20
Opinions expressed here may not reflect my company's positions unless
otherwise noted.
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications =
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat=3D=
121642
_______________________________________________
icu-support mailing list - icu...@li...
To Un/Subscribe: =
https://lists.sourceforge.net/lists/listinfo/icu-support
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications =
in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=107521&bid$8729&dat=121642
_______________________________________________
icu-support mailing list - icu...@li...
To Un/Subscribe: =
https://lists.sourceforge.net/lists/listinfo/icu-support
|