Answer the question
In order to leave comments, you need to log in
How to remove the timezone from the date and set the end of the day?
I am using React
Datepicker library . I get the date, but it comes with a +6 time zone: Wed Mar 28 2018 06:00:00 GMT+0600 (+06) - March 28 selection example.
The question is the following: I need to remove the timezone and set the time to the end of the day. I tried a lot, in the end, the maximum I got was exactly 17.59 on this date (-6 hours from 23.59).
Answer the question
In order to leave comments, you need to log in
If you understand correctly, you want to get:
For this, as mentioned above, use moment.js like this:
Read more in the official documentation . You should be interested in the second parameter. Just in case, here are some examples:
moment('2018.01.01 12:00:00+06:00').utcOffset(0, false).format(); // '2018.01.01 06:00:00+00:00'
moment('2018.01.01 12:00:00+06:00').utcOffset(0, true).format(); // '2018.01.01 12:00:00+00:00'
she comes with a time zoneShe doesn't go anywhere. It uses the moment library, check its documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question