f



238 seconds

Can someone explain this?

anon@lowtide:~$ date +%s
1481697888
anon@lowtide:~$

anon@lowtide:~$ date -d @1481697888
Wed Dec 14 01:44:48 EST 2016
anon@lowtide:~$ TZ=UTC date -d @1481697888
Wed Dec 14 06:44:48 UTC 2016
anon@lowtide:~$ 

anon@lowtide:~$ date -d@-67768040609723038
Thu Jan  1 00:00:00 LMT -2147481748
anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
Thu Jan  1 04:56:02 UTC -2147481748
anon@lowtide:~$ 

Why an offset of 4:56:02 instead of the expected 5:00:00 ?

0
deplorable
12/14/2016 6:49:29 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (349) is leader. Post Follow

10 Replies
119 Views

Similar Articles

[PageSpeed] 58

On 14-12-16 07:49, deplorable owl wrote:
> Can someone explain this?
>
> anon@lowtide:~$ date +%s
>
> anon@lowtide:~$
>
> anon@lowtide:~$ date -d @1481697888
> Wed Dec 14 01:44:48 EST 2016
> anon@lowtide:~$ TZ=UTC date -d @1481697888
> Wed Dec 14 06:44:48 UTC 2016
> anon@lowtide:~$
>
> anon@lowtide:~$ date -d@-67768040609723038
> Thu Jan  1 00:00:00 LMT -2147481748
> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
> Thu Jan  1 04:56:02 UTC -2147481748
> anon@lowtide:~$
>
> Why an offset of 4:56:02 instead of the expected 5:00:00 ?
>

I do see a complete other difference:
luuk@opensuse:~> date -d@-67768040609723038
do jan  1 05:15:34 LMT -2147481748
luuk@opensuse:~> TZ=UTC date -d@-67768040609723038
do jan  1 04:56:02 UTC -2147481748
luuk@opensuse:~>


But the docs say:
"Convert seconds since the epoch (1970-01-01 UTC) to a date"

And '-67768040609723038' would be before 1970-01-01, therefore the 
result is undefined?
0
Luuk
12/14/2016 7:08:33 AM
Luuk <luuk@invalid.lan> wrote:
> On 14-12-16 07:49, deplorable owl wrote:
>> Can someone explain this?
>>
>> anon@lowtide:~$ date +%s
>>
>> anon@lowtide:~$
>>
>> anon@lowtide:~$ date -d @1481697888
>> Wed Dec 14 01:44:48 EST 2016
>> anon@lowtide:~$ TZ=UTC date -d @1481697888
>> Wed Dec 14 06:44:48 UTC 2016
>> anon@lowtide:~$
>>
>> anon@lowtide:~$ date -d@-67768040609723038
>> Thu Jan  1 00:00:00 LMT -2147481748
>> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
>> Thu Jan  1 04:56:02 UTC -2147481748
>> anon@lowtide:~$
>>
>> Why an offset of 4:56:02 instead of the expected 5:00:00 ?
>>
> 
> I do see a complete other difference:
> luuk@opensuse:~> date -d@-67768040609723038
> do jan  1 05:15:34 LMT -2147481748
> luuk@opensuse:~> TZ=UTC date -d@-67768040609723038
> do jan  1 04:56:02 UTC -2147481748
> luuk@opensuse:~>
> 
> 
> But the docs say:
> "Convert seconds since the epoch (1970-01-01 UTC) to a date"
> 
> And '-67768040609723038' would be before 1970-01-01, therefore the 
> result is undefined?

It functions correctly for dates earlier though.

anon@lowtide:~$ date -d "1 Jan 1950" +%s
-631134000
anon@lowtide:~$ date -d @-631134000
Sun Jan  1 00:00:00 EST 1950
anon@lowtide:~$ 

Subtracting one more second from -67768040609723038 and it overflows.
"Valid" seconds appear to range from seconds values where the year
component is greater than or equal to INT_MIN+1900 years to seconds
values where year component is less than or equal to INT_MAX+1900
years.

For me:
INT_MAX: 2147483647
INT_MIN: -2147483648 

anon@lowtide:~$ date -d @-67768040609723038
Thu Jan  1 00:00:00 LMT -2147481748
anon@lowtide:~$ date -d @-67768040609723039
date: time -67768040609723039 is out of range
anon@lowtide:~$ 
anon@lowtide:~$ echo "2147483647+1900"|bc
2147485547
anon@lowtide:~$ date -d @67768036191694799
Wed Dec 31 23:59:59 EST 2147485547
anon@lowtide:~$ date -d @67768036191694800
date: time 67768036191694800 is out of range
anon@lowtide:~$ 

I'm not sure exactly where the 238 second discrepancy crops
up, but the EST/UTC thing keeps 5 hours for most every date
I check.

Maybe it has something to do with LMT (Is that Local Mean Time?).

anon@lowtide:~$ date -d @-100000000001038
Mon Feb 24 09:00:00 LMT -3166904
anon@lowtide:~$ TZ=UTC date -d @-100000000001038
Mon Feb 24 13:56:02 UTC -3166904
anon@lowtide:~$ 

anon@lowtide:~$ date -d @-10000000001038
Sun Aug 13 01:00:00 LMT -314918
anon@lowtide:~$ TZ=UTC date -d @-10000000001038
Sun Aug 13 05:56:02 UTC -314918
anon@lowtide:~$ 

Ahh... a clue:

anon@lowtide:~$ date -d @-1000001038
Sun Apr 24 17:56:02 EDT 1938
anon@lowtide:~$ date -d @-10000001038
Mon Feb 10 01:00:00 LMT 1653
anon@lowtide:~$ 

0
deplorable
12/14/2016 8:19:31 AM
deplorable owl <owl@rooftop.invalid> wrote:
> Luuk <luuk@invalid.lan> wrote:
>> On 14-12-16 07:49, deplorable owl wrote:
>>> Can someone explain this?
>>>
>>> anon@lowtide:~$ date +%s
>>>
>>> anon@lowtide:~$
>>>
>>> anon@lowtide:~$ date -d @1481697888
>>> Wed Dec 14 01:44:48 EST 2016
>>> anon@lowtide:~$ TZ=UTC date -d @1481697888
>>> Wed Dec 14 06:44:48 UTC 2016
>>> anon@lowtide:~$
>>>
>>> anon@lowtide:~$ date -d@-67768040609723038
>>> Thu Jan  1 00:00:00 LMT -2147481748
>>> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
>>> Thu Jan  1 04:56:02 UTC -2147481748
>>> anon@lowtide:~$
>>>
>>> Why an offset of 4:56:02 instead of the expected 5:00:00 ?
>>>
>> 
>> I do see a complete other difference:
>> luuk@opensuse:~> date -d@-67768040609723038
>> do jan  1 05:15:34 LMT -2147481748
>> luuk@opensuse:~> TZ=UTC date -d@-67768040609723038
>> do jan  1 04:56:02 UTC -2147481748
>> luuk@opensuse:~>
>> 
>> 
>> But the docs say:
>> "Convert seconds since the epoch (1970-01-01 UTC) to a date"
>> 
>> And '-67768040609723038' would be before 1970-01-01, therefore the 
>> result is undefined?
> 
> It functions correctly for dates earlier though.
> 
> anon@lowtide:~$ date -d "1 Jan 1950" +%s
> -631134000
> anon@lowtide:~$ date -d @-631134000
> Sun Jan  1 00:00:00 EST 1950
> anon@lowtide:~$ 
> 
> Subtracting one more second from -67768040609723038 and it overflows.
> "Valid" seconds appear to range from seconds values where the year
> component is greater than or equal to INT_MIN+1900 years to seconds
> values where year component is less than or equal to INT_MAX+1900
> years.
> 
> For me:
> INT_MAX: 2147483647
> INT_MIN: -2147483648 
> 
> anon@lowtide:~$ date -d @-67768040609723038
> Thu Jan  1 00:00:00 LMT -2147481748
> anon@lowtide:~$ date -d @-67768040609723039
> date: time -67768040609723039 is out of range
> anon@lowtide:~$ 
> anon@lowtide:~$ echo "2147483647+1900"|bc
> 2147485547
> anon@lowtide:~$ date -d @67768036191694799
> Wed Dec 31 23:59:59 EST 2147485547
> anon@lowtide:~$ date -d @67768036191694800
> date: time 67768036191694800 is out of range
> anon@lowtide:~$ 
> 
> I'm not sure exactly where the 238 second discrepancy crops
> up, but the EST/UTC thing keeps 5 hours for most every date
> I check.
> 
> Maybe it has something to do with LMT (Is that Local Mean Time?).
> 
> anon@lowtide:~$ date -d @-100000000001038
> Mon Feb 24 09:00:00 LMT -3166904
> anon@lowtide:~$ TZ=UTC date -d @-100000000001038
> Mon Feb 24 13:56:02 UTC -3166904
> anon@lowtide:~$ 
> 
> anon@lowtide:~$ date -d @-10000000001038
> Sun Aug 13 01:00:00 LMT -314918
> anon@lowtide:~$ TZ=UTC date -d @-10000000001038
> Sun Aug 13 05:56:02 UTC -314918
> anon@lowtide:~$ 
> 
> Ahh... a clue:
> 
> anon@lowtide:~$ date -d @-1000001038
> Sun Apr 24 17:56:02 EDT 1938
> anon@lowtide:~$ date -d @-10000001038
> Mon Feb 10 01:00:00 LMT 1653
> anon@lowtide:~$ 
> 

And here's when it changed.

anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
Fri Nov 16 00:00:00 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
Sat Nov 17 00:00:00 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
Sun Nov 18 00:00:00 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
Sun Nov 18 23:56:02 EST 1883
anon@lowtide:~$ 

0
deplorable
12/14/2016 9:19:10 AM
deplorable owl <owl@rooftop.invalid> wrote:
> deplorable owl <owl@rooftop.invalid> wrote:
>> Luuk <luuk@invalid.lan> wrote:
>>> On 14-12-16 07:49, deplorable owl wrote:
>>>> Can someone explain this?
>>>>
>>>> anon@lowtide:~$ date +%s
>>>>
>>>> anon@lowtide:~$
>>>>
>>>> anon@lowtide:~$ date -d @1481697888
>>>> Wed Dec 14 01:44:48 EST 2016
>>>> anon@lowtide:~$ TZ=UTC date -d @1481697888
>>>> Wed Dec 14 06:44:48 UTC 2016
>>>> anon@lowtide:~$
>>>>
>>>> anon@lowtide:~$ date -d@-67768040609723038
>>>> Thu Jan  1 00:00:00 LMT -2147481748
>>>> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
>>>> Thu Jan  1 04:56:02 UTC -2147481748
>>>> anon@lowtide:~$
>>>>
>>>> Why an offset of 4:56:02 instead of the expected 5:00:00 ?
>>>>
>>> 
>>> I do see a complete other difference:
>>> luuk@opensuse:~> date -d@-67768040609723038
>>> do jan  1 05:15:34 LMT -2147481748
>>> luuk@opensuse:~> TZ=UTC date -d@-67768040609723038
>>> do jan  1 04:56:02 UTC -2147481748
>>> luuk@opensuse:~>
>>> 
>>> 
>>> But the docs say:
>>> "Convert seconds since the epoch (1970-01-01 UTC) to a date"
>>> 
>>> And '-67768040609723038' would be before 1970-01-01, therefore the 
>>> result is undefined?
>> 
>> It functions correctly for dates earlier though.
>> 
>> anon@lowtide:~$ date -d "1 Jan 1950" +%s
>> -631134000
>> anon@lowtide:~$ date -d @-631134000
>> Sun Jan  1 00:00:00 EST 1950
>> anon@lowtide:~$ 
>> 
>> Subtracting one more second from -67768040609723038 and it overflows.
>> "Valid" seconds appear to range from seconds values where the year
>> component is greater than or equal to INT_MIN+1900 years to seconds
>> values where year component is less than or equal to INT_MAX+1900
>> years.
>> 
>> For me:
>> INT_MAX: 2147483647
>> INT_MIN: -2147483648 
>> 
>> anon@lowtide:~$ date -d @-67768040609723038
>> Thu Jan  1 00:00:00 LMT -2147481748
>> anon@lowtide:~$ date -d @-67768040609723039
>> date: time -67768040609723039 is out of range
>> anon@lowtide:~$ 
>> anon@lowtide:~$ echo "2147483647+1900"|bc
>> 2147485547
>> anon@lowtide:~$ date -d @67768036191694799
>> Wed Dec 31 23:59:59 EST 2147485547
>> anon@lowtide:~$ date -d @67768036191694800
>> date: time 67768036191694800 is out of range
>> anon@lowtide:~$ 
>> 
>> I'm not sure exactly where the 238 second discrepancy crops
>> up, but the EST/UTC thing keeps 5 hours for most every date
>> I check.
>> 
>> Maybe it has something to do with LMT (Is that Local Mean Time?).
>> 
>> anon@lowtide:~$ date -d @-100000000001038
>> Mon Feb 24 09:00:00 LMT -3166904
>> anon@lowtide:~$ TZ=UTC date -d @-100000000001038
>> Mon Feb 24 13:56:02 UTC -3166904
>> anon@lowtide:~$ 
>> 
>> anon@lowtide:~$ date -d @-10000000001038
>> Sun Aug 13 01:00:00 LMT -314918
>> anon@lowtide:~$ TZ=UTC date -d @-10000000001038
>> Sun Aug 13 05:56:02 UTC -314918
>> anon@lowtide:~$ 
>> 
>> Ahh... a clue:
>> 
>> anon@lowtide:~$ date -d @-1000001038
>> Sun Apr 24 17:56:02 EDT 1938
>> anon@lowtide:~$ date -d @-10000001038
>> Mon Feb 10 01:00:00 LMT 1653
>> anon@lowtide:~$ 
>> 
> 
> And here's when it changed.
> 
> anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
> Fri Nov 16 00:00:00 LMT 1883
> anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
> Sat Nov 17 00:00:00 LMT 1883
> anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
> Sun Nov 18 00:00:00 LMT 1883
> anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
> Sun Nov 18 23:56:02 EST 1883
> anon@lowtide:~$ 
> 

And the exact second of the change:

anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400+12*3600+3*60+55"|bc)
Sun Nov 18 12:03:55 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400+12*3600+3*60+56"|bc)
Sun Nov 18 12:03:56 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400+12*3600+3*60+57"|bc)
Sun Nov 18 12:03:57 LMT 1883
anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400+12*3600+3*60+58"|bc)
Sun Nov 18 12:00:00 EST 1883
anon@lowtide:~$

There's the 238 seconds.  But why?


0
deplorable
12/14/2016 9:42:41 AM
deplorable owl <owl@rooftop.invalid> writes:
>deplorable owl <owl@rooftop.invalid> wrote:

>
>And here's when it changed.
>
>anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
>Fri Nov 16 00:00:00 LMT 1883
>anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
>Sat Nov 17 00:00:00 LMT 1883
>anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
>Sun Nov 18 00:00:00 LMT 1883
>anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
>Sun Nov 18 23:56:02 EST 1883
>anon@lowtide:~$ 
>

http://www.history.com/this-day-in-history/railroads-create-the-first-time-zones
0
scott
12/14/2016 1:42:53 PM
Scott Lurndal <scott@slp53.sl.home> wrote:
> deplorable owl <owl@rooftop.invalid> writes:
>>deplorable owl <owl@rooftop.invalid> wrote:
> 
>>
>>And here's when it changed.
>>
>>anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
>>Fri Nov 16 00:00:00 LMT 1883
>>anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
>>Sat Nov 17 00:00:00 LMT 1883
>>anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
>>Sun Nov 18 00:00:00 LMT 1883
>>anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
>>Sun Nov 18 23:56:02 EST 1883
>>anon@lowtide:~$ 
>>
> 
> http://www.history.com/this-day-in-history/railroads-create-the-first-time-zones

Thanks!

And there's this:
http://historymatters.gmu.edu/d/5748/
<quote>
The long glistening rod and its heavy cylindrical pendulum ball was at
rest for 3 minutes and 58.38 seconds.
</quote>

0
deplorable
12/14/2016 4:51:44 PM
deplorable owl <owl@rooftop.invalid> writes:
>Scott Lurndal <scott@slp53.sl.home> wrote:
>> deplorable owl <owl@rooftop.invalid> writes:
>>>deplorable owl <owl@rooftop.invalid> wrote:
>> 
>>>
>>>And here's when it changed.
>>>
>>>anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
>>>Fri Nov 16 00:00:00 LMT 1883
>>>anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
>>>Sat Nov 17 00:00:00 LMT 1883
>>>anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
>>>Sun Nov 18 00:00:00 LMT 1883
>>>anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
>>>Sun Nov 18 23:56:02 EST 1883
>>>anon@lowtide:~$ 
>>>
>> 
>> http://www.history.com/this-day-in-history/railroads-create-the-first-time-zones
>
>Thanks!
>
>And there's this:
>http://historymatters.gmu.edu/d/5748/
><quote>
>The long glistening rod and its heavy cylindrical pendulum ball was at
>rest for 3 minutes and 58.38 seconds.
></quote>
>

The article also has the wonderful phrase "vermillion topped Hibernian".
0
scott
12/14/2016 5:27:16 PM
On 14-12-16 17:51, deplorable owl wrote:
> Scott Lurndal <scott@slp53.sl.home> wrote:
>> deplorable owl <owl@rooftop.invalid> writes:
>>> deplorable owl <owl@rooftop.invalid> wrote:
>>
>>>
>>> And here's when it changed.
>>>
>>> anon@lowtide:~$ date -d @$(echo "-2745428638+319*86400"|bc)
>>> Fri Nov 16 00:00:00 LMT 1883
>>> anon@lowtide:~$ date -d @$(echo "-2745428638+320*86400"|bc)
>>> Sat Nov 17 00:00:00 LMT 1883
>>> anon@lowtide:~$ date -d @$(echo "-2745428638+321*86400"|bc)
>>> Sun Nov 18 00:00:00 LMT 1883
>>> anon@lowtide:~$ date -d @$(echo "-2745428638+322*86400"|bc)
>>> Sun Nov 18 23:56:02 EST 1883
>>> anon@lowtide:~$
>>>
>>
>> http://www.history.com/this-day-in-history/railroads-create-the-first-time-zones
>
> Thanks!
>
> And there's this:
> http://historymatters.gmu.edu/d/5748/
> <quote>
> The long glistening rod and its heavy cylindrical pendulum ball was at
> rest for 3 minutes and 58.38 seconds.
> </quote>
>

it's probably also in this answer:
https://lmgtfy.com/?q=238+seconds

0
Luuk
12/14/2016 7:26:15 PM
> anon@lowtide:~$ date +%s
> 1481697888
> anon@lowtide:~$
> 
> anon@lowtide:~$ date -d @1481697888
> Wed Dec 14 01:44:48 EST 2016
> anon@lowtide:~$ TZ=UTC date -d @1481697888
> Wed Dec 14 06:44:48 UTC 2016
> anon@lowtide:~$ 
> 
> anon@lowtide:~$ date -d@-67768040609723038
> Thu Jan  1 00:00:00 LMT -2147481748
> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
> Thu Jan  1 04:56:02 UTC -2147481748
> anon@lowtide:~$ 
> 
> Why an offset of 4:56:02 instead of the expected 5:00:00 ?

Why would you expect all time zones to have an integral number of
hours for an offset?  It seems to me that there are some places
that use half-hour and quarter-hour offsets.  And didn't some areas
use solar time?  (at least as recent as 1980?) That's not only not
an integral number of hours, but it's also not constant.

According to www.timetempeature.com:
India: GMT+5:30
Nepal: GMT+5:45
North Korea: GMT+8:30
Iran: GMT+3:30
North Australia: GMT+9:30
South Australia: GMT+10:30
Western Australia: GMT+8:45
Chatham Islands: GMT+13:45
Marquesas Islands: GMT-9:30
And a number of these seem to match up with the tzdata files.


What does LMT stand for?  I hope it isn't "Lunar Mountain Time".
Seeing that the time involved is over 2 billion years ago, is this
Dinosaur Standard Time?  (Do we even have much of an idea about how
long a day was that long ago?) Just how far back do the time zone
description files go?  If LMT stands for solar time through the
town hall of some location, I'm not surprised the offset is an odd
fraction of an hour.


0
gordonb
12/15/2016 8:58:14 AM
Gordon Burditt <gordonb.q8rzy@burditt.org> wrote:
>> anon@lowtide:~$ date +%s
>> 1481697888
>> anon@lowtide:~$
>> 
>> anon@lowtide:~$ date -d @1481697888
>> Wed Dec 14 01:44:48 EST 2016
>> anon@lowtide:~$ TZ=UTC date -d @1481697888
>> Wed Dec 14 06:44:48 UTC 2016
>> anon@lowtide:~$ 
>> 
>> anon@lowtide:~$ date -d@-67768040609723038
>> Thu Jan  1 00:00:00 LMT -2147481748
>> anon@lowtide:~$ TZ=UTC date -d@-67768040609723038
>> Thu Jan  1 04:56:02 UTC -2147481748
>> anon@lowtide:~$ 
>> 
>> Why an offset of 4:56:02 instead of the expected 5:00:00 ?
> 
> Why would you expect all time zones to have an integral number of
> hours for an offset?

Who ever said that I expected that?  And why would you think that
it has anything at all to do with an apparently changing offset
within a given timezone? 

>  It seems to me that there are some places
> that use half-hour and quarter-hour offsets.  And didn't some areas
> use solar time?  (at least as recent as 1980?) That's not only not
> an integral number of hours, but it's also not constant.
> 

If you had read the other posts in the thread, you would have seen
that the mystery was already solved before you put your two cents
in.
 
<snip> 

0
deplorable
12/23/2016 6:16:24 AM
Reply: