Answer the question
In order to leave comments, you need to log in
date-fns has a getISODay() method, how can I convert the result of the method, taking into account the offset of the front, if the back is 10800 (+3), and the front itself is 28800 (+8)?
date-fns has a getISODay() method, how can I convert the result of the method, taking into account the offset of the front, if the back is 10800 (+3), and the front itself is 28800 (+8)
thanks)
Answer the question
In order to leave comments, you need to log in
((+8 (Irkutsk?))-(+3 (Moscow?)))*60(seconds in a minute)*60(minutes in an hour)+10800(seconds from midnight in Moscow)=28800(seconds from midnight in Irkutsk )
In general, it is recommended to store UTC time in the database (it is also GMT + 0), in order to avoid confusion (you can additionally store the time zone). So you can do +3*60*60 on the back and +8*60*60 on the front and get GMT+0 in both cases.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question