ravi
ravi

Reputation: 17

How to get IST and PST string from a date in Angular material?

I need to store IST and PST strings based on the current browser timezone.

I have used moment library to get that string, but it throws an error, I have tried several other ways as well but did not get the desired string

const timezone = moment.tz(moment.tz.guess()).format('z');
console.log(timezone); // eg: PST   

Upvotes: 1

Views: 49

Answers (0)

Related Questions