转自:http://www.linuxde.net/2011/10/1033.html 在实际操作中,一些脚本中会调用明天,或者昨天,或更多天前的日期,本文将叙述讲述用date命令实现时间的显示.在Linux系统中用man date -d 查询的参数说的比较模糊,以下举例进一步说明: # man date-d, --date=STRINGdisplay time described by STRING, not ‘now’ 查看明天日期# date -d next-day +%Y%m%d# da
talk is cheap,show me the code! //获取昨天 var day1 = new Date(); day1.setTime(day1.getTime()-24*60*60*1000); var yesterDate = day1.getFullYear()+"/" + (day1.getMonth()+1) + "/" + day1.getDate(); //获取当前日期 var date = new Date(); var year =
分类: SQL Server select GETDATE() as '当前日期',DateName(year,GetDate()) as '年',DateName(month,GetDate()) as '月',DateName(day,GetDate()) as '日',DateName(dw,GetDate()) as '星期',DateName(week,GetDate()) as '周数',DateName(hour,GetDate()) as '时',DateName(minute
格林威治时间即UTC/GMT时间,1970年01月01日00时00分00秒(即UTC+8的北京时间1970年01月01日08时00分00秒)计算代码如下: /** * 获取指定时间到格林威治时间的秒数 * UTC:格林威治时间1970年01月01日00时00分00秒(UTC+8北京时间1970年01月01日08时00分00秒) * @param time * @return */ public static long diffSeconds(String time){ Calendar cale