转换2022-04-20T17:00:00.000Z到TimePicker格式
I have a value like 2022-04-20T17:00:00.000Z, I want to convert it like as in image which is only accepts in antd timepicker,
How to convert?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
安装
MOMM
库:npm安装矩
然后将其导入您的项目
从“ MONM MONM”
使用它来格式化日期
const MomentDate = Moment(“ 2022-04-20T17:00:00.000Z”)
Install the
moment
library:npm install moment
Then import it into your project
import moment from "moment"
use it to format your date
const momentDate = moment("2022-04-20T17:00:00.000Z")
您可以为此使用时刻。
有关更多datils,您可以请访问MORM
You can use the moment for this.
For more datils, you can visit moment document
)
这样
您可以简单地
new Date (
you can simply
new Date()
like this to convert given timestamp into required format
then you can also extract only the part you want