Convert GMT to IST India Standard Time using javascript

0 votes

I have a date format is GMT or UTC.

var mydate  = '2020-01-14T17:43:37.000Z'

I want to convert this date in IST format so according to this date the output I need in this format.

var date = '2020-Jan-15 12:45'
Nov 4, 2022 in Java by Nicholas
• 7,760 points
19,901 views

1 answer to this question.

0 votes

You can specify an IANA time zone identifier in the options passed to toLocaleString. The identifier for India is Asia/Kolkata.

var s = new Date('2020-01-14T17:43:37.000Z').toLocaleString(undefined, {timeZone: 'Asia/Kolkata'});

The input is in UTC, thus this will convert to the appropriate time zone (as specified by the Z at the end).

answered Nov 7, 2022 by Damonlang
• 700 points

Related Questions In Java

0 votes
1 answer

How to convert a date string to a DateTime object using Joda Time library?

DateTimeFormatter formatter = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); DateTime dt = ...READ MORE

answered Jan 9, 2019 in Java by Daisy
• 8,140 points
2,392 views
0 votes
0 answers

How to get the current London time and date using javascript

Using the code below, I attempted to& ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
1,107 views
0 votes
2 answers

How to convert an int array to string using tostring method in java?

Use java.util.Arrays: String res = Arrays.toString(array); System. ...READ MORE

answered Aug 16, 2019 in Java by Sirajul
• 59,230 points
2,355 views
+1 vote
1 answer

Converting a date string to a DateTime object using Joda Time library

Use DateTimeFormat: DateTimeFormatter formatter = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss"); DateTime dt = ...READ MORE

answered Jul 24, 2018 in Java by scarlett
• 1,290 points
4,827 views
0 votes
0 answers

How to get the Australian Time Zone using Javascript?

I am trying to help a friend ...READ MORE

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
1,150 views
0 votes
1 answer

Differentiate between Tokyo and Seoul Time zone

if DST and Offset are the only ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,720 points
518 views
0 votes
1 answer

How do I get the current date in JavaScript?

To ensure that you get the current ...READ MORE

answered Feb 18, 2022 in Java by Aditya
• 7,680 points
547 views
0 votes
1 answer

Parsing a string to a date in JavaScript

The best string format for string parsing ...READ MORE

answered Feb 18, 2022 in Java by Aditya
• 7,680 points
607 views
0 votes
1 answer

How to decode jwt token in javascript without using a library?

Working unicode text JWT parser function: function parseJwt ...READ MORE

answered Nov 4, 2022 in Java by Damonlang
• 700 points
7,220 views
0 votes
1 answer

How to get current formatted date dd/mm/yyyy in Javascript and append it to an input

The stringent equality operator (===) works exactly like the abstract equality operator (==), with the exception that no type conversion is performed, and the types must be the same to be regarded equal. Javascript Tutorial on Comparison Operators After performing any required type transformations, the == operator will check for equality.  Because the === operator does not perform the conversion, it will simply return false if two values are not of the same type.  Both are equally fast. "abc" == new String("abc") ...READ MORE

answered Nov 4, 2022 in Java by Damonlang
• 700 points
1,420 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP