我想以 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/