通过JavaScript重新获取日期72小时 [英] Getting date 72 hours back through javascript

查看:224
本文介绍了通过JavaScript重新获取日期72小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.....

我希望通过JavaScript与时间一起将日期打印72小时.有人可以帮忙吗?

谢谢...

Hi all.....

I want the date to be printed 72 hours back with time through javascript. Can anybody please help.

Thanks...

推荐答案

类似的东西:

something like this:

var mydate= new Date()
mydate.setDate(mydate.getDate()-3)

var theyear=mydate.getFullYear()
var themonth=mydate.getMonth()+1
var theyesterday=mydate.getDate()

document.write("Data as of 72 hours back: ")
document.write(themonth+"/"+theyesterday+"/"+theyear)


这篇关于通过JavaScript重新获取日期72小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆