如何在 javascript 中获取 unix 格式的昨天日期?
我正在自学 REST 概念并使用 Flickr API。 Flickr 需要的参数之一是 min_upload_date
,它采用 Unix 日期格式,在示例中如下所示...
&min_upload_date=1199145600
我想设置 min_upload_date
> 到今天的前一天,但我什至不知道从哪里开始。我在 javascript 中找到了 Date()
对象,并弄清楚了如何将其设置为等于昨天的日期,但如何将其转换为 Flickr 需要的格式?
预先感谢您的所有帮助!
I'm self-learning the REST concept and am playing with the Flickr API. One of the parameters that Flickr requires is the min_upload_date
, which is formatted in the Unix date format and looks like this in the example...
&min_upload_date=1199145600
I'd like to set the min_upload_date
to the day before the current day, but I don't even know where to start with this. I've found the Date()
object in javascript and figured out how to set it equal to yesterday's date, but how do I convert it to the format that Flickr needs?
Thanks in advance for all your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用
.getTime()
< /strong> 在您拥有的Date
对象上:call
.getTime()
on theDate
object you have: