*年*月*日 下午*点*分 日期格式的js生成
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;
clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"下午":"上午";
alert(yr+'年'+today.getMonth()+'月'+today.getDate()+'日 '+clck+clckh+'点'+clckm+'分')
这样就可以实现类似:
2008年10月17日 下午6点03分
本文来自博客园,作者:CarlZeng,转载请注明原文链接:https://www.cnblogs.com/backuper/archive/2008/11/17/1335291.html
需求沟通链接 扫客服加群: