【问题标题】:How can I display the date and time in dayjs 12hours clock? using dayjs如何在 dayjs 12 小时时钟中显示日期和时间?使用dayjs
【发布时间】:2022-11-14 23:18:21
【问题描述】:

由于 mui 日期时间选择器,这是我第一次使用 dayjs。

所以在这张图片中,我已经得到了交易,但问题是当前时间。我只喜欢获取日期、日期、小时和分钟。

 2022-11-14T14:42:30.080Z

所以在这里而不是显示

我想收到

 2022-11-14 10:42 PM

这是我的表格单元格

<TableCell align="left">{recent.location} & {recent.time}</TableCell>

【问题讨论】:

    标签: javascript reactjs mern dayjs


    【解决方案1】:
    dayjs(YOUR_DATE).format('YYYY-MM-DD h:mm A')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-15
      • 2021-11-06
      • 2021-09-29
      • 2014-04-15
      • 1970-01-01
      • 2021-10-13
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多