John Peacock <[EMAIL PROTECTED]> wrote: > Peter J. Acklam wrote: > > > Perl's gmtime() and localtime() aren't UTC compatible. > > I'd say they are using TAI time. GMT belongs to the past. > > Except you'd be wrong. ;~)
Conveniently for me, the pages you quote back me up, not you. > GMT == UTC for all intents and purposes: UTC and GMT are different in several aspects. The definition of UTC is different than that of GMT, and UTC has leap seconds whereas GMT doesn't. > http://www.wikipedia.org/wiki/Coordinated_Universal_Time That page says "UTC bases time measurement on atomic standards rather than GMT's celestial ones." so UTC is not GMT. > http://www.webreference.com/js/tips/010929.html That page says "UTC isn't the same as GMT (proper GMT was originally measured from Greenwich mean mid-day, not mid-night [proof: Astronomical Almanacs 1984 onwards, page B5]), as UTC is an ATOMIC time-scale, while GMT (strictly speaking UT1 [UT-one]) is tied to the rotation of the Earth in respect to the fictitious 'mean Sun'." again showing that GMT is not UTC. > Perl is not using TAI, but rather the underlying O/S epoch > (which usually means UTC). I didn't mean that Perl is using a TAI library, but the TAI time system or TAI calendar. The reason why I suggested TAI was that in the TAI time system there are no leap seconds and every second has the same length. GMT doesn't have leap seconds either, but the length of each second is not a fixed value. And you say that Perl is "usually" using UTC. Then please show me some examples of Perl giving the following, which would be correct for an UTC clock. Actually, just one example would be nice. $ perl -wle 'print scalar gmtime $_ for 78796799 .. 78796801' Fri Jun 30 23:59:59 1972 Fri Jun 30 23:59:60 1972 Sat Jul 1 00:00:00 1972 The second before 1972-07-01 00:00:00 UTC was a leap second (the first leap second after 1970). Every version of Perl I have available gives me $ perl -wle 'print scalar gmtime $_ for 78796799 .. 78796801' Fri Jun 30 23:59:59 1972 Sat Jul 1 00:00:00 1972 Sat Jul 1 00:00:01 1972 happily ignoring the leap second. Peter -- #!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*- # matlab comment stripper (strips comments from Matlab m-files) s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
