Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Anonymous,bruncher,niord,gvonge,Shelford, for Donating to support the site

Date format in a JSON file

Straight answers to factual questions
Forum rules
Direct questions and answers, this room is not for general discussion please
Hypster
Lemon Slice
Posts: 258
Joined: November 5th, 2016, 9:53 am
Has thanked: 1229 times
Been thanked: 109 times

Date format in a JSON file

#437440

Postby Hypster » August 25th, 2021, 11:06 pm

Can anyone explain how to read this date format (i.e. to derive what day/month/year it is)?

"createdAt":1292246940

It's a timestamp inside a JSON file.

XFool
The full Lemon
Posts: 12636
Joined: November 8th, 2016, 7:21 pm
Been thanked: 2609 times

Re: Date format in a JSON file

#437444

Postby XFool » August 25th, 2021, 11:17 pm

...It's 13 Dec 2010 01:29:00 PM :)

https://bytutorial.com/web-tools/timestamp-to-date-converter

If you need a routine to do this I'm sure further details are available online.

pochisoldi
Lemon Slice
Posts: 949
Joined: November 4th, 2016, 11:33 am
Has thanked: 32 times
Been thanked: 464 times

Re: Date format in a JSON file

#437453

Postby pochisoldi » August 25th, 2021, 11:38 pm

Hypster wrote:Can anyone explain how to read this date format (i.e. to derive what day/month/year it is)?

"createdAt":1292246940

It's a timestamp inside a JSON file.


It's a Unix timestamp, the number of seconds since 1st Jan 1970.

UncleEbenezer
The full Lemon
Posts: 10980
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1505 times
Been thanked: 3050 times

Re: Date format in a JSON file

#437461

Postby UncleEbenezer » August 26th, 2021, 12:03 am

Lots of fun in January 2038, as the clock overflows on any remaining 32-bit representations of time. I wonder if the meeja will hype it as they did Y2K?

There may even be a legacy of code so badly written that the simple solution of recompiling on 64-bits (or more) is insufficient.

servodude
Lemon Half
Posts: 8598
Joined: November 8th, 2016, 5:56 am
Has thanked: 4563 times
Been thanked: 3682 times

Re: Date format in a JSON file

#437464

Postby servodude » August 26th, 2021, 12:12 am

UncleEbenezer wrote:Lots of fun in January 2038, as the clock overflows on any remaining 32-bit representations of time. I wonder if the meeja will hype it as they did Y2K?

There may even be a legacy of code so badly written that the simple solution of recompiling on 64-bits (or more) is insufficient.


64 bits?
UTC is signed - change that and they can kick the can down the road for another 68 years

- sd

Hypster
Lemon Slice
Posts: 258
Joined: November 5th, 2016, 9:53 am
Has thanked: 1229 times
Been thanked: 109 times

Re: Date format in a JSON file

#437486

Postby Hypster » August 26th, 2021, 7:35 am

Thank you for the answers, I really appreciate your help!

UncleEbenezer
The full Lemon
Posts: 10980
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1505 times
Been thanked: 3050 times

Re: Date format in a JSON file

#437562

Postby UncleEbenezer » August 26th, 2021, 12:00 pm

servodude wrote:
UncleEbenezer wrote:Lots of fun in January 2038, as the clock overflows on any remaining 32-bit representations of time. I wonder if the meeja will hype it as they did Y2K?

There may even be a legacy of code so badly written that the simple solution of recompiling on 64-bits (or more) is insufficient.


64 bits?
UTC is signed - change that and they can kick the can down the road for another 68 years

- sd

Someone evidently thought 68 years would be ample.

I expect they were right, too. Around two thirds of the way through the 68 years, 64-bits became standard in pretty-much all general-purpose hardware (64 bits kicks the can down the road for many times the age of the universe). If they'd made it unsigned, the generation reaching crunch point in 2106 would have no memory of less-than-64-bit hardware.

How many today remember working with "far pointers"? Or even shaking our heads at those whose misfortune it was to have to? Even LFS support is becoming obsolete, except when you get the question about big files - usually in the context of archiving to a USB stick.

(post-hoc rationalisation can be fun :D ).


Return to “Does anyone know?”

Who is online

Users browsing this forum: No registered users and 4 guests