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 in Java by Nicholas
• 7,120 points
688 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 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,120 points
868 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,190 points
1,705 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
3,642 views
0 votes
1 answer

How to convert a string representation of a hex dump to a byte array using Java?

public static byte[] hexStringToByteArray(String s) { ...READ MORE

answered Sep 26, 2018 in Java by sharth
• 3,350 points
1,102 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 in Web Development by gaurav
• 22,040 points
195 views
0 votes
1 answer

Differentiate between Tokyo and Seoul Time zone

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

answered Feb 11 in Others by narikkadan
• 37,660 points
93 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 in Java by Aditya
• 7,660 points
68 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 in Java by Aditya
• 7,660 points
89 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 in Java by Damonlang
• 700 points
146 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 in Java by Damonlang
• 700 points
57 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