admin管理员组文章数量:1336168
My question is more about logic not code.I created something called prepared messages with time i supply to each new message, i pare the time with current time and give each row a background. Is it possible for me to fetch the time with javascript only the current time NO DATE. Regards
My question is more about logic not code.I created something called prepared messages with time i supply to each new message, i pare the time with current time and give each row a background. Is it possible for me to fetch the time with javascript only the current time NO DATE. Regards
Share Improve this question asked Jan 24, 2010 at 19:26 SarahSarah 4952 gold badges11 silver badges23 bronze badges4 Answers
Reset to default 2To pare only the time, without year, month and day taken into account, try the following:
var now = new Date().setFullYear(1, 0, 1)
, andThen = new Date(dateMessageSent).setFullYear(1, 0, 1)
if (now > andThen) doYourStuff()
Yes, see Date.getTime()
d = new Date();
var time=d.toTimeString();
Take a look at the Date Object and in particular the following methods
- toTimeString()
- getHours()
- getMinutes()
- getSeconds()
本文标签: Return only time irrelevant date javascriptStack Overflow
版权声明:本文标题:Return only time irrelevant date javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742240204a2438782.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论