gpt4 book ai didi

javascript - 将momentjs中的年份格式更改为佛教纪元

转载 作者:行者123 更新时间:2023-11-29 15:32:04 24 4
gpt4 key购买 nike

我想以 B.E.(佛教纪元)格式显示日期/时间,例如 2015 -> 2558

moment().format('D MMMM YYYY  H:mm:ss')

有什么想法吗?

最佳答案

 date.toLocaleDateString('th-TH', { day: 'numeric', month: 'short', year: 'numeric' });

你有没有试过这个。

附言。这不是 moment.js 而是 vanila js。

关于javascript - 将momentjs中的年份格式更改为佛教纪元,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33854497/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com