[英]Convert date in Javascript (luxon)
I am using luxon to convert the date:我正在使用 luxon 来转换日期:
console.log(DateTime.now('Sun Jan 23 2003 00:00:00 GMT+0200 (Eastern European Standard Time)').toISODate())
Now i get: 2022-04-07
.现在我得到:
2022-04-07
。 But this is today's day, but i need to get this format from this: Sun Jan 23 2003 00:00:00 GMT+0200 (Eastern European Standard Time)
.但今天是今天,但我需要从中获取这种格式:
Sun Jan 23 2003 00:00:00 GMT+0200 (Eastern European Standard Time)
。
How to get this using luxon
library?如何使用
luxon
库获取它?
Try using console.log(DateTime.local('Sun Jan 23 2003 00:00:00 GMT+0200 (Eastern European Standard Time)').toISODate()).尝试使用 console.log(DateTime.local('Sun Jan 23 2003 00:00:00 GMT+0200 (East European Standard Time)').toISODate())。 By using DateTime.now(etc...), it automatically returns the current date.
通过使用 DateTime.now(etc...),它会自动返回当前日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.