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

Format date using moment React

I have created ** React Component** class Test extends Component{ state = { birthdate: '2020-09-20' } render(){ const {birthdate} = this.state; const mdiffInDays = moment(moment()).diff(moment(birthdate), 'days'); const…
4est
  • 3,010
  • 6
  • 41
  • 63
-1
votes
2 answers

Change variable by firing JavaScript date event

Hi I am working on a project where client wants to update a variable at 12:00 PM Technologies: CodeIgniter 3 Bootstrap 4 js JQuery UI Any help will be appreciated!
-1
votes
1 answer

How to set a different timezone without changing the time

Given a moment time, how do you change the timezone without changing the actual time? For example if you have 2020-06-19 16:30:00+00 but you want this in America/New_York timezone. The output would be 2020-06-19 16:30:00-04:00 (currently Daylight…
b.lyte
  • 6,518
  • 4
  • 40
  • 51
-1
votes
2 answers

moment.fromNow() timezone issue

I am getting post of news from server with date that doesnt includes timezone, i know that posts is from EST time zone, example : March 30, 2020 at 10:53 AM (-5 GMT); When post was just updated like few seconds ago moment.fromNow() showing me it was…
-1
votes
1 answer

Moment toJSON does not consider timezione

I've angular application with moment@2.24.0. I do this simple actions: let test = moment('2019112200:00','YYYYMMDDmm:ss'); console.log(test .toJSON()); the result is 2019-11-21T23:00:00.000Z i think it doesn't consider timezone. With…
Pippi
  • 313
  • 1
  • 4
  • 18
-1
votes
2 answers

Array of random locations - moment-timezone.js

How can I find a random location based on the moment-timezone.js? I want to show a new location every time you refresh the page. Current code:

Present time

Martin
  • 23
  • 4
-1
votes
2 answers

how to convert javascript date according to a new timezone

I thought I had a handle on this, but I cant work it out. scenario: 1) user selects a date widget which passes back a date in local timezone, lets say 10am 'Australia/Sydney' 2) user then selects a timezone that is different, by identifier…
-2
votes
1 answer

What is LLL can represent into luxonjs

In my project, I have this in moment for time, this one, moment().format('LLL') // June 9 2014 9:32 PM moment().format('D MMM YYYY[,] HH[:]mm z') but if I use this in luxon how can i make this format in luxon, for example, given below, …
GCT
  • 43
  • 7
-2
votes
1 answer

How to add timezone offset to string without changing the time?

I have a time string like this 2021-12-29T01:30:00.105Z. I want to add offset for a timezone without changing the date and time. So it should look like this after conversion - 2021-12-29T01:30:00+08:00 for "Asia/Kuala_Lumpur" timezone. So…
doctorsherlock
  • 1,334
  • 4
  • 19
  • 41
-2
votes
1 answer

How to format Time Duration using moment.js

I have written code to find out the diff of two Dates. I have successfully done this. but the output has given so long format like that: DIFF-DATE 0.019110277777777778:1.1466166666666666:68.797. But I want to format like that 01:20:59 means…
Vijay Gehlot
  • 80
  • 1
  • 10
-4
votes
1 answer

How to convert (20190909070000+0000) to timespan like mm/dd/yyyy hh:mm:ss pm by using moment.js

I am trying to convert datetime "20190909070000+0000" value into mm/dd/yyyy hh:mm:ss pm by using moment.js. Kindly assist me on this.
Ranjan Singh
  • 123
  • 2
  • 9
1 2 3
26
27