简体   繁体   中英

How to convert datetime variable to string in JavaScript?

如何在JavaScript中将datetime变量转换为字符串?

I've had a lot of success with Datejs . It took away a lot of pain.

我不知道你在说什么类型的DateTime变量,所以我假设你在谈论Date

var stringVal = someDateVar.toString();
var stringrepresentation = datetimevalue.toString();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM