Author Topic: About time zones...  (Read 9372 times)

0 Members and 1 Guest are viewing this topic.

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: About time zones...
« Reply #25 on: July 18, 2017, 10:33:07 am »
Don't forget to account for general relativity.  |O

... another bag  of worms.

And, of course, there's the everyday[1] problem of two clocks separated by a significant distance (and hence time), where "significant" is of the order of the tick duration :) That's a fundamental problem; see Leslie Lamport's seminal work to find out the best that can be achieved.

[1] most frequently seen when trying to decide which version of a file is more recent, in a distributed file system.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline mc172

  • Frequent Contributor
  • **
  • Posts: 487
  • Country: gb
Re: About time zones...
« Reply #26 on: July 18, 2017, 12:53:40 pm »
Simple example... A one second duration (number of times an ion has waggled its tail) can finish an >hour later than it started, e.g. 00:01:59.5 to 03:00:00.5 Or, of course, finish before it started.

 :o Eh? Please explain, I'm curious to understand!

Remember what happened on Sunday, 26 March 2017 at 01:00?
And will happen on Sunday 29 October at 02:00, in the UK?

Right, do you mean 01:59:59.5, then?

 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: About time zones...
« Reply #27 on: July 18, 2017, 02:08:14 pm »
Simple example... A one second duration (number of times an ion has waggled its tail) can finish an >hour later than it started, e.g. 00:01:59.5 to 03:00:00.5 Or, of course, finish before it started.

 :o Eh? Please explain, I'm curious to understand!

Remember what happened on Sunday, 26 March 2017 at 01:00?
And will happen on Sunday 29 October at 02:00, in the UK?

Right, do you mean 01:59:59.5, then?

Maybe. Complicated and error prone, this time and calendar stuff :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: About time zones...
« Reply #28 on: July 18, 2017, 02:26:22 pm »
OK I admit it... interesting things do happen when humans and calendars are involved... I spent my New Year watching 23:59:60

 :)
« Last Edit: July 18, 2017, 02:42:05 pm by NivagSwerdna »
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: About time zones...
« Reply #29 on: July 18, 2017, 02:28:09 pm »
Maybe. Complicated and error prone, this time and calendar stuff :)

Agreed. Two things that I would not develop myself if there is any way to avoid it:
  • Cryptography
  • Time/date handling
« Last Edit: July 18, 2017, 03:16:16 pm by alm »
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: About time zones...
« Reply #30 on: July 18, 2017, 03:00:37 pm »
For me I usually just says F with time zones - it is the last thing I add into my code (along with other i18n/l10n stuff) and the core code is always based on some kind of epoch for time manipulation. Most code uses either UNIX epoch (1970-01-01T00:00:00Z, counting seconds using integers) or NeXTSTEP epoch (2001-01-01T00:00:00Z, counting seconds using double-precision float point numbers.)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: About time zones...
« Reply #31 on: July 18, 2017, 03:04:25 pm »
Maybe. Complicated and error prone, this time and calendar stuff :)

Agreed. Two things that I would not develop myself if there is anyway to avoid it:
  • Cryptography
  • Time/date handling

We are in violent agreement.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: About time zones...
« Reply #32 on: July 18, 2017, 03:08:34 pm »
For me I usually just says F with time zones - it is the last thing I add into my code (along with other i18n/l10n stuff) and the core code is always based on some kind of epoch for time manipulation. Most code uses either UNIX epoch (1970-01-01T00:00:00Z, counting seconds using integers) or NeXTSTEP epoch (2001-01-01T00:00:00Z, counting seconds using double-precision float point numbers.)

Sometimes it isn't possible to avoid them :(

In one incarnation I was developing soft realtime mobile phone charging systems. The tariff depended on the time of day/week/month/user and marketing whims. If the call is originated in Western Australia, terminated in the UK, and the billing system is in Canada, you have to be very careful which timezone you are meant to be using!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: About time zones...
« Reply #33 on: July 18, 2017, 03:18:48 pm »
In one incarnation I was developing soft realtime mobile phone charging systems. The tariff depended on the time of day/week/month/user and marketing whims. If the call is originated in Western Australia, terminated in the UK, and the billing system is in Canada, you have to be very careful which timezone you are meant to be using!
And then you find out that the energy company was using Microsoft Excel for billing, and you have to modify your date handling to match theirs :P.

Offline @rt

  • Super Contributor
  • ***
  • Posts: 1051
Re: About time zones...
« Reply #34 on: July 18, 2017, 03:29:56 pm »
I spent too much time explaining to my boss that people on 1st floor should be paid more than people on ground floor,
because the people working on the 1st floor adhered to a clock on the ground floor (with regard to working hours).
 
The following users thanked this post: NivagSwerdna, alm

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: About time zones...
« Reply #35 on: July 18, 2017, 03:52:08 pm »
The same effect causes GPS clocks to run fast by 45us/day... it's a big effect!
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: About time zones...
« Reply #36 on: July 18, 2017, 05:23:29 pm »
For me I usually just says F with time zones - it is the last thing I add into my code (along with other i18n/l10n stuff) and the core code is always based on some kind of epoch for time manipulation. Most code uses either UNIX epoch (1970-01-01T00:00:00Z, counting seconds using integers) or NeXTSTEP epoch (2001-01-01T00:00:00Z, counting seconds using double-precision float point numbers.)

Sometimes it isn't possible to avoid them :(

In one incarnation I was developing soft realtime mobile phone charging systems. The tariff depended on the time of day/week/month/user and marketing whims. If the call is originated in Western Australia, terminated in the UK, and the billing system is in Canada, you have to be very careful which timezone you are meant to be using!
Epoch-ify the time at ingress. Define time periods always on UTC internally, you are set.
 

Offline r3bers

  • Contributor
  • Posts: 26
  • Country: ru
    • solovjov.net
Re: About time zones...
« Reply #37 on: April 02, 2018, 11:26:06 pm »
The Empire on which the sun never sets.
 

Offline Daixiwen

  • Frequent Contributor
  • **
  • Posts: 351
  • Country: no
Re: About time zones...
« Reply #38 on: April 03, 2018, 07:20:57 am »
An interesting list: falsehoods programmers believe about time
http://infiniteundo.com/post/25509354022/more-falsehoods-programmers-believe-about-time
 
The following users thanked this post: VinzC


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf