O
O
office12018-10-08 16:32:41
Java
office1, 2018-10-08 16:32:41

How to convert the date in seconds from Christmas Chr. convert to calendar date?

There is a specific date in the format 63672393600, which is in seconds since Christmas.
How to convert it to a calendar date? If all calendars in java come from 01/01/1970?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Satisfied IT, 2018-10-08
@efficeon1

Calculate how many seconds in a year and divide, we get the number of years, the remainder is months, by analogy with the year, and so on to the desired accuracy

G
GavriKos, 2018-10-08
@GavriKos

How to convert it to a calendar date

What calendar? And do you consider high-powered ones according to modern standards or not? And a bunch of all sorts of fucking changes in the chronology how to take into account?
I offer a simple solution. Do you know what the date "63672393600" is? Take the same date in unix timestamp (from 01/01/1970), subtract the second from the first. Get a constant offset. And then when you need to translate your date - first subtract the constant offset from it (in fact it will be 01/01/1970 in your format) and then consider it as a regular unix timestamp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question