Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material UI Time Picker UTC

I've been looking through the docs and playing around on my own with material ui and I do not see any sort of setting to be able to choose the time in UTC. It always defaults to my local timezone for the time picker, even if I pass in a UTC Date object. Is anyone aware of a workaround for this?

like image 305
Bruce Avatar asked Mar 07 '26 11:03

Bruce


1 Answers

Only way is to format your Date into String then use moment-timezone

var newYork    = moment.tz("2014-06-01 12:00", "America/New_York");

var losAngeles = newYork.clone().tz("America/Los_Angeles");

var london     = newYork.clone().tz("Europe/London");

I hope it will be support in material-ui

like image 73
Mickael Avatar answered Mar 09 '26 01:03

Mickael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!