Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
QuarkJets
Sep 8, 2008

Suspicious Dish posted:

i thought it was that it wasn't easily divisible by the rotation around the sun (exact year doesn't divide into exact day)

That is fundamentally the reason, but since the Earth doesn't rotate at a constant rate we can't just have N leap seconds every M years, like we do for leap days. So it's more accurate to say that leap days roughly take care of the effect that you describe and that leap seconds deal with changes in rotation

(also, whereas leap days are always positive, leap seconds can be negative!)

QuarkJets fucked around with this message at 22:01 on Aug 19, 2017

Adbot
ADBOT LOVES YOU

Dylan16807
May 12, 2010

QuarkJets posted:

They're not pointless. They address the fact that the Earth's rate of rotation is not a constant

Look at how inaccurate time zones are. Is 35 seconds of offset really that big of a problem?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Then there's Google's Leap Smear, where they slowly sneak in the extra second over a 24 hour period. I've never had to deal with that, but it sounds like the fun.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Dylan16807 posted:

Look at how inaccurate time zones are. Is 35 seconds of offset really that big of a problem?

Yeah like in several instances

If you're navigating, doing cryptography, radio telescopy, again navigating, bombing things, space stuff, communicating, etc ...

One is, "yeah we have to all agree on what time it is to function as humans in a society" and the other is more technical.

QuarkJets
Sep 8, 2008

Dylan16807 posted:

Look at how inaccurate time zones are. Is 35 seconds of offset really that big of a problem?

Time zones are a whole different horrible mess, don't go acting like time zones being stupid and hosed up means that we can just ignore leap seconds and leap days

Satellite navigation and communication systems don't give a poo poo about bumblefuck timezones but they do need celestial time to match up pretty well with atomic time ("pretty well" being much, much better than 35 seconds)

canis minor
May 4, 2011

Nothing instills me with more confidence towards my bank than a 500 error page. Combine that with sending me a link to reset my password, that is incorrect. I'll be having a talk with a consultant tomorrow regarding that.

In other news though:



edit: aaaaaaaaaaaaaargh.. "You're membership number". I'm not native speaker, but spelling errors of that caliber irk me to no end.

canis minor fucked around with this message at 23:32 on Aug 19, 2017

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
I work in telecom and we use PTP and GPS timing all over the place because we need nanosecond level precision, but I'm not sure I understand what either of those timing systems would lose if we got rid of leap seconds.

Not saying this to challenge the importance of leap seconds, just saying I don't understand.

Edit: Oh nevermind, I missed the post about satellite communications needing celestial time to match up. I think I understand.

Dylan16807
May 12, 2010

dougdrums posted:

Yeah like in several instances

If you're navigating, doing cryptography, radio telescopy, again navigating, bombing things, space stuff, communicating, etc ...

One is, "yeah we have to all agree on what time it is to function as humans in a society" and the other is more technical.

No, no, I'm not arguing against precise time at all.

I'm saying that where we need a precise time standard to micro and nanoseconds it should not have leap seconds, and who cares if the Earth's rotation is "wrong" by 35 seconds when that's constantly drifting anyway and smeared over zones an hour across. It especially should not have leap seconds because that encourages a "smear" technique that destroys all that hard-earned precision.


QuarkJets posted:

Time zones are a whole different horrible mess, don't go acting like time zones being stupid and hosed up means that we can just ignore leap seconds and leap days

Satellite navigation and communication systems don't give a poo poo about bumblefuck timezones but they do need celestial time to match up pretty well with atomic time ("pretty well" being much, much better than 35 seconds)

UTC already drifts up to .9 seconds off celestial time. Don't use UTC or TAI when you need celestial time.

sarehu
Apr 20, 2007

(call/cc call/cc)
Another option instead of leap seconds would be to gradually migrate time zone boundaries. Each leap second needs under half a kilometer's adjustment.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

If we're going to do that I say get rid of timezones altogether.

QuarkJets
Sep 8, 2008

sarehu posted:

Another option instead of leap seconds would be to gradually migrate time zone boundaries. Each leap second needs under half a kilometer's adjustment.

That doesn't actually fix things like geospatial pointing accuracy though

Dylan16807 posted:

No, no, I'm not arguing against precise time at all.

I'm saying that where we need a precise time standard to micro and nanoseconds it should not have leap seconds, and who cares if the Earth's rotation is "wrong" by 35 seconds when that's constantly drifting anyway and smeared over zones an hour across. It especially should not have leap seconds because that encourages a "smear" technique that destroys all that hard-earned precision.


UTC already drifts up to .9 seconds off celestial time. Don't use UTC or TAI when you need celestial time.

Accuracy to within 0.9 seconds is fine in a lot of cases where accuracy to within 30 seconds is not fine. "Oh just always use celestial time" doesn't actually solve the problem because there aren't a lot of easy ways to accurately calculate celestial time, whereas keeping atomic time is just accepted practice now. Being able to translate accurately between the two means having your cake and eating it too: you get the extremely accurate time-keeping capabilities of atomic time coupled to the imperfect-but-still-very-accurate utility of accurate geospatial accuracy based on celestial time

We use leap seconds because that's actually more accurate than trying to maintain celestial time via other means

QuarkJets fucked around with this message at 02:24 on Aug 20, 2017

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Thermopyle posted:

If we're going to do that I say get rid of timezones altogether.

I've been arguing for this position for awhile. Nobody ever agreed with me before. :saddowns:

QuarkJets
Sep 8, 2008

Definitely we should get rid of timezones but that doesn't mean you can get rid of leap seconds

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
Personally I just use Swatch internet time.

ThisIsNoZaku
Apr 22, 2013

Pew Pew Pew!
A contractor we're hiring asked if we want tests written with JUnit or Mockito.

The Fool
Oct 16, 2003


Fergus Mac Roich posted:

Personally I just use Swatch internet time.

This man gets it.

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

TooMuchAbstraction posted:

I've been arguing for this position for awhile. Nobody ever agreed with me before. :saddowns:

I agreed with you without ever having the conversation, and I think China did as well.

Volguus
Mar 3, 2009

Thermopyle posted:

If we're going to do that I say get rid of timezones altogether.

Exactly. Why should anyone be in a different timezone than mine? My timezone is the best and it beats all of the others combined. EST rules.

CPColin
Sep 9, 2003

Big ol' smile.
Too bad it's currently EDT and not EST!

Space Kablooey
May 6, 2009


I'm just reading all this mess about time zones and I'm just wondering what kind of mess that will happen when we get to colonies on other planets. I also fully expect that at least one colony will declare independence from Earth and declare that the year of their founding will be their Year 1.

Absurd Alhazred
Mar 27, 2010

by Athanatos

HardDiskD posted:

I'm just reading all this mess about time zones and I'm just wondering what kind of mess that will happen when we get to colonies on other planets. I also fully expect that at least one colony will declare independence from Earth and declare that the year of their founding will be their Year 1.

Well, for starters, the time is not really going to sync because of the different gravity and the changes in relative velocity throughout the various parts of the respective orbits.

Dylan16807
May 12, 2010

QuarkJets posted:

Accuracy to within 0.9 seconds is fine in a lot of cases where accuracy to within 30 seconds is not fine.
That's 150 feet of slop, I don't know. And if you're keeping your clock within a second you probably have access to a network or GPS, both of which can give you a much more precise offset than .9 seconds.

quote:

"Oh just always use celestial time" doesn't actually solve the problem because there aren't a lot of easy ways to accurately calculate celestial time, whereas keeping atomic time is just accepted practice now.
Couldn't you use the same leap-second-style offset math if you really wanted? Use cases that need it can do the simple math, the other 99% can avoid dealing with discontinuous time.

Carbon dioxide
Oct 9, 2012

ThisIsNoZaku posted:

A contractor we're hiring asked if we want tests written with JUnit or Mockito.

Heh. Suggest Docker just to mess with them.

QuarkJets
Sep 8, 2008

Dylan16807 posted:

That's 150 feet of slop, I don't know. And if you're keeping your clock within a second you probably have access to a network or GPS, both of which can give you a much more precise offset than .9 seconds.

Couldn't you use the same leap-second-style offset math if you really wanted? Use cases that need it can do the simple math, the other 99% can avoid dealing with discontinuous time.

GPS time is just another kind of atomic time. Using GPS doesn't solve the problem of having to match two out-of-sync timekeeping systems.

That's exactly why UTC was created: it includes the offsets necessary to bring atomic time in-line with celestial time. They only differ by the total number of leap seconds. Applications that use UTC but that need to be insensitive to the insertion of leap seconds are at fault for using the wrong timekeeping system; they should use something like GPS or TAI, which do not include leap seconds.

Mr Shiny Pants
Nov 12, 2012
So after all this time talk, what is the best way to store it and retrieve it? I have some timestamps that I keep track off and they need to be represented in a GUI, with respect to the user's timezone.

So store them as UTC in the DB and let the GUI format it?

Carbon dioxide
Oct 9, 2012

Mr Shiny Pants posted:

So after all this time talk, what is the best way to store it and retrieve it? I have some timestamps that I keep track off and they need to be represented in a GUI, with respect to the user's timezone.

So store them as UTC in the DB and let the GUI format it?

Do not EVER deal with timezones at all and store datetimes without timezones unless you have a specific usecase of having to coordinate between multiple ones. In that case first make sure that all input sources add the correct timezone and then yeah, storing it UTC is not a bad idea. ISO-8601 standard datetime Strings, which you should use if your db doesn't have a specific datetime format, allows you to store them with timezones, like 2017-08-20T05:53:45+01:00 but doing so means you need a lot of checks and calculations to translate things into whatever timezone the output wants. UTC makes it simpler.

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

Mr Shiny Pants posted:

So after all this time talk, what is the best way to store it and retrieve it? I have some timestamps that I keep track off and they need to be represented in a GUI, with respect to the user's timezone.

So store them as UTC in the DB and let the GUI format it?

Store UTC as Unix time in a 64 bit signed integer. Do not roll your own library for conversions, existing libraries to format Unix time already deal with leap seconds and that kind of nonsense.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

HardDiskD posted:

I'm just reading all this mess about time zones and I'm just wondering what kind of mess that will happen when we get to colonies on other planets.

My dim recollection of relativity says that simultaneity is kind of bunk anyway; it's just not as noticeable on Earth because the distances are too short. And even then, GPS satellites have to have some kind of compensation. When the distances are bigger, the issue gets thornier. The Moon is ~1 light second away -- but other planets will have a much more widely-varying time-delay.

I expect that each planet would end up instituting its own local time and have a system library that'd do things like "If I were to send a message to this location on Earth right now, when would it arrive in their time system?"

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The people who developed and maintain datetime libraries are unsung heroes.

Vanadium
Jan 8, 2005

Treating time as UTC epoch timestamps isn't always suitable when you're like tracking, like, a weekly meeting room schedule has to stay at the same wall clock time across daylight saving bullshit. But that's probably just a thing you want to avoid having to do.

nielsm
Jun 1, 2009



Vanadium posted:

Treating time as UTC epoch timestamps isn't always suitable when you're like tracking, like, a weekly meeting room schedule has to stay at the same wall clock time across daylight saving bullshit. But that's probably just a thing you want to avoid having to do.

Singular meeting events should probably timestamped with time zone, while the recurring event definition should be made with timezone-less times. Holidays and similar whole-day calendar events are also defined on dates without times or timezones.

brap
Aug 23, 2004

Grimey Drawer
What is a "timezone-less" time? UTC? While a "timestamp with time zone" is local time?

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

Vanadium posted:

Treating time as UTC epoch timestamps isn't always suitable when you're like tracking, like, a weekly meeting room schedule has to stay at the same wall clock time across daylight saving bullshit. But that's probably just a thing you want to avoid having to do.

I don't see why this couldn't be handled with UTC epoch timestamps. mktime in the C standard library handles daylight savings.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

my girlfriend is Legos posted:

I'm writing some front end stuff for a partner of ours and found a bit of a peculiarity about their API. After first trying it out and fetching some data, on a hunch I decided to check the UNIX timestamp it returned. Sure enough, it was off by two hours. Their server is located in CET, so I figured they probably accidentally used DateTime.Now instead of DateTime.UtcNow when generating the timestamp. Fair enough, I guess that's an understandable mistake. I asked one of their developers if he knew about it, and turns out that nope, it was a very deliberate decision to return an integer named 'Time' that looks exactly like a UNIX timestamp but is secretly the server's local time minus 1/1 1970 00:00 UTC and thus doesn't conform to standard, because "in 99% of cases you want local time".

What do they on the switch to/from daylight savings time?

Dylan16807
May 12, 2010

QuarkJets posted:

GPS time is just another kind of atomic time. Using GPS doesn't solve the problem of having to match two out-of-sync timekeeping systems.
I meant that the full GPS signal has a number listing the Earth's rotation offset in arc seconds, and with more precision than 0.9. You'd still only use one timekeeping system.

quote:

That's exactly why UTC was created: it includes the offsets necessary to bring atomic time in-line with celestial time. They only differ by the total number of leap seconds. Applications that use UTC but that need to be insensitive to the insertion of leap seconds are at fault for using the wrong timekeeping system; they should use something like GPS or TAI, which do not include leap seconds.
Agreed there, I just think that wanting to avoid leap seconds should be the everyday default option. Leap seconds should be the exotic option, not the other way around.

Thermopyle posted:

The people who developed and maintain datetime libraries are unsung heroes.
Very much so.

CPColin
Sep 9, 2003

Big ol' smile.

fleshweasel posted:

What is a "timezone-less" time? UTC? While a "timestamp with time zone" is local time?

It's either a string like "08:15" or an integer for the hour and one for the minute. So if you want to store a recurring meeting schedule of "Weekly on Monday at 08:15" you store "Weekly," "Monday," and "08:15," instead of something like "Weekly, starting on 8/21, at 08:15 Pacific."

nielsm
Jun 1, 2009



fleshweasel posted:

What is a "timezone-less" time? UTC? While a "timestamp with time zone" is local time?

Timezone is defined versus undefined. A wall clock time with no declaration of timezone is timezone-less, but you need to interpret it within some later-defined timezone to form a real timestamp.

Imagine a cruise ship crossing the Pacific ocean, it has a sign posted: "Breakfast is served every morning from 7 to 10." Those times are timezone-less, because you need to interpret it in the current local time zone every day. Arguably it would also be better to post it as "from 7 am and the following 3 hours", to handle the case of crossing a timezone boundary in the middle of breakfast which could otherwise be interpreted as lengthening/shortening it.

Vanadium
Jan 8, 2005

Prev job used floats for time of day db fields. So like 5.3 was five thirty.

Absurd Alhazred
Mar 27, 2010

by Athanatos
I am so glad all I care about is frame-by-frame timing.

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012

https://web.archive.org/web/20170817113559/https://github.com/Microsoft/vscode/issues/32405

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply