Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要像这样显示日期格式 2012 年 4 月 15 日上午 10 点 12 分。我尝试使用 javascript 使用 time=new Date()。但我无法获得正确的日期格式。它显示 GMT 全球时间。我需要显示时间格式。请问有人可以知道吗?
看看DateJS。如果您打算对日期做更多的事情而不仅仅是格式化它,我强烈建议您这样做。通过操作和显示绝对让事情变得更容易。
最简单的事情是使用库:尝试Moment,这是真正的交易。