Material UI Time Picker UTC

喜你入骨 提交于 2019-12-13 07:39:48

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/37789619/material-ui-time-picker-utc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!