6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 8:54 am

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: OT: time epochs
PostPosted: Wed Feb 20, 2019 9:36 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
As a tangent to a nearby discussion ...

1752 or 1753 are interesting choices of epoch, but also 1858 is interesting:

Quote:
Why [Open]VMS regards November 17, 1858 as the beginning of time...

The modified Julian date adopted by SAO (Smithsonian Astrophysical Observatory) for satellite tracking is Julian Day 2400000, which turns out to be November 17, 1858.

SAO started tracking satellites with an 8K (nonvirtual) 36-bit IBM 704 in 1957 when Sputnik went into orbit. The Julian day was 2435839 on January 1, 1957. This is 11225377 octal, which was too big to fit into an 18-bit field. With only 8K of memory, the 14 bits left over by keeping the Julian date in its own 36-bit word would have been wasted. They also needed the fraction of the current day (for which 18 bits gave enough accuracy), so it was decided to keep the number of days in the left 18 bits and the fraction of a day in the right 18 bits of one word.

Eighteen bits allows the truncated Julian day (the SAO day) to grow as large as 262143, which from November 17, 1858, allowed for 7 centuries. Possibly, the date could only grow as large as 131071 (using 17 bits), but this still covers 3 centuries and leaves the possibility of representing negative time. The 1858 date preceded the oldest star catalogue in use at SAO, which also avoided having to use negative time in any of the satellite tracking calculations.


via the article The stories behind 12 computer system reference dates


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 4:31 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
BigEd wrote:
As a tangent to a nearby discussion ...

1752 or 1753 are interesting choices of epoch, but also 1858 is interesting...

When I concocted my timekeeping melange I did consider January 1, 1753 for an epoch. However, I decided to be perverse about it and get as close to the time when the British Empire switched to the Gregorian calendar. That's how I ended up with October 1, 1752. :D BTW, 1752 was a leap year.

Interesting aside: supposedly all versions of MS Windows based on the NT kernel have their epoch in the year 1600. However, I've discovered that if I set the last write date of a file on one of my Linux servers to midnight January 1, 1980 or earlier and then display the directory in Windows (via Samba) no date and time is displayed for the file entry. I'm don't think this is a Linux or Samba thing.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 4:43 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1466
Location: Scotland
BigEd wrote:


Humour, but https://xkcd.com/927/ is always relevant.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 4:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
For ease of reference, from the linked article (which has much more detail):

    January 1, 1: used by .NET, Go (start of the Gregorian calendar)
    October 14, 1582: used by z/OS (first use of Gregorian calendar)
    January 1, 1601: used by Microsoft Windows (convenient 400 year cycle in Gregorian calendar)
    January 1, 1753: used by Sybase, pre-2005 Microsoft SQL Server (UK and American colonies adopt Gregorian calendar)
    December 31, 1840 used by MUMPS (earliest birth year of living person)
    November 17, 1858 used by OpenVMS (Julian date modified for modern era)
    January 0, 1900 used by Microsoft Excel (compatibility with Lotus including leap bug)
    January 1, 1904 used by Mac OS through version 9, LabVIEW (easy leap year handling)
    January 1, 1970 used by Unix and many related systems (round date suited to limited seconds count)
    January 1, 1980 used by DOS, OS/2, FAT16, FAT32 (round date suited to limited years count)
    January 6, 1980 used by GPS satellites (round date suited to limited weeks count)
    January 1, 2001 used by Apple’s Cocoa API (convenient start of 400 year cycle)


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 4:54 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
drogon wrote:
Humour, but https://xkcd.com/927/ is always relevant.

It's a good one. See also
https://xkcd.com/1930/

Calendar geekery is quite a thing.

Edit: perhaps also https://xkcd.com/2050/


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 5:51 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
BigEd wrote:
For ease of reference, from the linked article (which has much more detail):

    January 1, 1: used by .NET, Go (start of the Gregorian calendar)

Pedantically speaking, January 1, 1 would be the proleptic Gregorian calendar, which is a mathematical approximation of what the date would have been had the Gregorian calendar existed prior to its introduction.

The Gregorian calendar's "official" starting date is October 15, 1582, which is when it replaced the Julian calendar, which had been in use since Julius Caesar's time. At the time the Gregorian calendar was introduced, the Julian calendar was at October 4, 1582 and was about 10 days out of sync with the equinoxes and solstices. Virtually all of this error was due to incorrect leap year rules in the Julian calendar.

An interesting bit of tedious minutia: as I earlier mentioned, the British Empire didn't adopt the Gregorian calendar until September 1752 (there were interesting religious/political reasons for the 170 year delay after Pope Gregory's new calendar was first adopted) and was still on the Julian calendar up until that time. While on the Julian calendar, the British Empire considered March 25 the first day of the new year. That's right: everyone else was getting drunk and disorderly on January 1, while the British waited until March 25 to hoist a glass or two. :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 6:51 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
There's still a remnant of that changed year-end convention:
Quote:
In order to ensure against losing revenue it was decided by the British Treasury that the tax year, which started on March 25 1752, would be of the usual length (365 days) and therefore it would end on April 4, the following tax year beginning on April 5.


(Seriously hoping we can avoid any discussion of taxation...)


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 8:07 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1228
Location: Soddy-Daisy, TN USA
Dates/times has always been a struggle. Most people really don't understand how they work or they don't understand why date calculations can sometimes be tricky.

For example, we have several applications that, for unknown reasons, were created so that a NULL representation of a date was Jan 1, 0000. So, 0000-01-01. Well, different databases have issues with this. Some don't like using a year of 0. IBM (DB2) and Microsoft (MS SQL) handle them quite differently. Some of our code is really ugly because we sometimes have to literally translate dates to/from strings so that they can be translated back to dates for different platforms.

It's a nightmare sometimes.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 8:19 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
I think I'm with BDD on this: use time-since-epoch for as long as you possibly can, until the last minute(!) when you need to convert to human format for human purposes - at which point timezones, leap years, leap seconds, international date lines, names for days of weeks, choices about week numbers, can all come into play.


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 9:34 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1466
Location: Scotland
BigEd wrote:
I think I'm with BDD on this: use time-since-epoch for as long as you possibly can, until the last minute(!) when you need to convert to human format for human purposes - at which point timezones, leap years, leap seconds, international date lines, names for days of weeks, choices about week numbers, can all come into play.


This.

It seems obvious now but early 90's when this Internet thing was starting to be a thing and I was managing a network for a company with offices in the UK and both coasts of the US... Things were fine in our Unix world until the other devices started being connected to the network - which then stored files with their localtime timestamp. It caused issues for a while with automatic build processes and people creating files in different time zones.

There is also 30+ years of a thing called comp.risks which those who've never heard of it might want to browse - every time change/daylight savings/clocks going forwards/back you'll find issues. I fear it will never go away.

So we ought to strive to set an example!

But here is an example from my own blog: https://projects.drogon.net/and-on-the- ... t-stopped/

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Wed Feb 20, 2019 10:13 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Nice blog post!

In not too many weeks we have a rollover of the GPS week counter - I won't be surprised to see some reports on the RISKS Digest in due course.


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Thu Feb 21, 2019 3:38 am 
Offline

Joined: Sat Dec 30, 2017 3:19 pm
Posts: 116
Location: Detroit, Michigan, USA
BigDumbDinosaur wrote:
Interesting aside: supposedly all versions of MS Windows based on the NT kernel have their epoch in the year 1600. However, I've discovered that if I set the last write date of a file on one of my Linux servers to midnight January 1, 1980 or earlier and then display the directory in Windows (via Samba) no date and time is displayed for the file entry. I'm don't think this is a Linux or Samba thing.


According to the article that BigEd linked MS-DOS uses 1/1/80 as its epoch, so I'm guessing the same limitation made its way into the SMB protocol as well.


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Thu Feb 21, 2019 5:07 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Incidentally, xkcd 2050 links to yet another, earlier xkcd detailing "Earth Standard Time". Its description starts off basically sane, and then goes decidedly off the rails…


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Thu Feb 21, 2019 5:10 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
jmthompson wrote:
BigDumbDinosaur wrote:
Interesting aside: supposedly all versions of MS Windows based on the NT kernel have their epoch in the year 1600. However, I've discovered that if I set the last write date of a file on one of my Linux servers to midnight January 1, 1980 or earlier and then display the directory in Windows (via Samba) no date and time is displayed for the file entry. I'm don't think this is a Linux or Samba thing.

According to the article that BigEd linked MS-DOS uses 1/1/80 as its epoch, so I'm guessing the same limitation made its way into the SMB protocol as well.

I don't know. SMB was a mish-mash co-developed by Microsoft and IBM back in the OS/2 days. No telling what is buried in there.

Samba appears to Windows as an NT server, and I have no reason to believe it is causing the date anomalies.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: OT: time epochs
PostPosted: Thu Feb 21, 2019 5:35 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
BigEd wrote:
I think I'm with BDD on this: use time-since-epoch for as long as you possibly can, until the last minute(!) when you need to convert to human format for human purposes - at which point timezones, leap years, leap seconds, international date lines, names for days of weeks, choices about week numbers, can all come into play.

At least in the UNIX/Linux world, leap seconds are handled at the operating system level by slewing the (software) clock. If the machine has access to a suitable time server, leap second correction will be automatic. Leap seconds are the only facet of timekeeping that is not handled by the higher level functions that convert internal clock time to broken-down time.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: