Questions tagged [moment-timezone]

Moment-timezone is an add-on for Moment.js that provides IANA time zone support. Use this tag for issues with moment-timezone, but also tag it with [moment]. NOTE: As of September 2020, the Moment team recommends you chose a different library for new projects. See the Project Status section of the Moment docs. On StackOverflow, please refrain from recommending Moment as a solution unless Moment is specifically asked for in the question.

Moment-timezone is an add-on for Moment.js that provides IANA time zone support.


Important:

As of September 2020, the Moment team recommends you choose a different library than Moment for new projects. Please read https://momentjs.com/docs/#/-project-status/

On StackOverflow, please refrain from recommending Moment as a solution unless Moment is specifically asked for in the question.

401 questions
-1
votes
1 answer

How do I convert a time from one timezone to another using Luxon

I have a time from the server with returns 2022-10-16T13:17:05.885+00:00 The time zone is 'Asia/Manila'. This time represents October 16, 2022, 9:17pm I want to convert this time to be read as October 16, 2022, 9:17pm, or the same as 'Asia/Manila' …
Markus
  • 85
  • 9
-1
votes
1 answer

Get list of abbreviated day of the week in moment using

I am using moment and I want to get list of abbreviated day of the week. so ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] I want to be able to use different languages to get these let resultDates = []; // array to hold day names const current…
Rain Man
  • 1,163
  • 2
  • 16
  • 49
-1
votes
1 answer

show UTC+7 instead of GMT+7 when formating using date-fns-tnz

I used to format timezone using moment-timezone and I use tz().format() and got result 04:25PM UTC+07:00 now it turn my friend move from moment-timezone to date-fns, im trying to achieve what i achieve using moment-timezone, but what i get is in GMT…
bramastaVic
  • 81
  • 1
  • 8
-1
votes
1 answer

i am getting badly confuse in moment.js i need to compare stored date and time in database with current time which is stored in the following format

i have a course database which includes starting and ending date and time i have to compare the end date and time with current (system) date and time to know weather the course is expired or not if the current time is lapsed with end time the stored…
-1
votes
1 answer

Setting UTC timezone with numeric values in JS [UTC+2, UTC+3, UTC-12, etc]

How can I create a date with a specific timezone like that [UTC+2, UTC+3, UTC-12, etc] but not with string like that 'America/New York' in js/moment.js? I have a list of all timezones from server in this format [UTC+2, UTC+3, UTC-12, etc], so I need…
-1
votes
1 answer

Moment Display Date according to ISO-8601 Timezone Offset

I am getting a ISO-8601 date string from an API response as follows : var x1 = 2022-06-22T05:30:00+05:30 or it could be var x2 = 2022-06-22T08:30:00-05:00 Irrespective of browser timezone I should display the dates as X1 - 2022-06-22 05:30:30…
Sahil Ali
  • 172
  • 3
  • 15
-1
votes
1 answer

How do I get the timezone using javascript?

How do I get the timezone using javascript? instead of America/New_York I want "Eastern Time - US/Canada 5:13pm" with the timestamp and country. How can I get that using React/Javascript? just like Calendly has it.
Chris Hansen
  • 7,813
  • 15
  • 81
  • 165
-1
votes
1 answer

How can I validate the formate of a date string that has timezone in it?

If I have a this date: April 14, 2022 14:00 UTC, how I can validate that it is in MMMM DD, YYYY HH:mm ? I tried it with moment but it doesn't have format for timezone. moment(date, 'MMMM DD, YYYY HH:mm',true).isValid() How can I validate…
-1
votes
1 answer

How to compare two dates in different formats

I have a two dates in one format 19/02/2026, 07/02/2012 and third date in 2021-05-19T12:51:11.630Z It's YYYY-MM-DDTHH:mm:ss.SSSSZ. And i need to check third date if it is between those to dates. But the problem is that i cannot find way how to do…
Vlad
  • 419
  • 1
  • 10
  • 21
-1
votes
1 answer

How to set given time zone as default instead of system time zone in Flatpickr?

Flatpickr is using the Date object internally and that always uses the local time of the computer as the default time. I m using Flatpickr version 4.6.6 Is there any way to set given time zone for flatpickr?
-1
votes
1 answer

Update Date or time from an ISO string moment JS library

What is the simplest way to update a day or time from a given string. For example I have a moment date in the following format. start: '2021-09-30T06:30:00-04:00' expected output: '2021-09-29T06:30:00-04:00' Now I want to keep the current time,…
WildThing
  • 969
  • 1
  • 12
  • 30
-1
votes
1 answer

moment.js time changes when formatted

I am experiencing some weird behaviour when using moment.js. I have an object with a date and timezone. When I type moment(obj.start_time).tz(timeZoneName), I get a time Image showing time before formatting. However, when I use the format method,…
sa00445
  • 1
  • 1
-1
votes
1 answer

Get Time in GMT based on the parameter Time & Timezone

I need to schedule a job daily at 1:30 AM, Here 1:30 AM is Timezone dependent. For Example: America/Chicago - 1:30 AM output should be GMT 06:30. Asia/Kolkata - 1:30 AM output should be GMT 20:00. Asia/Kabul - 1:30 AM output should be GMT 21:00 I…
Gurudeepak
  • 372
  • 2
  • 14
-1
votes
1 answer

how to check the string is valid date format or not (format should be in : YYYY-MM-DD HH:mm:ss)

how do I check whether string is valid date format or not? format should be in : YYYY-MM-DD HH:mm:ss console.log(moment(moment("FLAT 10").format('YYYY-MM-DD HH:mm:ss'),'YYYY-MM-DD HH:mm:ss').isValid())
vivek padelkar
  • 195
  • 1
  • 5
  • 31
-1
votes
1 answer

How can i fix timezone issue while using date format in moment.js?

This is my input date , let inputDate = '2021-01-15T11:22:10.000Z'. I want to change the date format to MM/DD/YYYY HH:mm:ss For that i used following i used moment.js . This is my code, moment(inputDate).format('MM/DD/YYYY HH:mm:ss') = 01/15/2021…
1 2 3
26
27