我从后端获取此日期。我需要将其与同类日期进行比较。我尝试了不同的帖子,但总是收到“无效日期”或“NAN”
字符串样本:2019 年 12 月 11 日星期三 16:02:54 CET
字符串示例:2019 年 12 月 11 日星期三 14:43:24 CET
最佳答案
您将需要 moment和 moment-timezone解析时区。
If you know the format of an input string, you can use that to parse a moment.
moment("12-25-1995", "MM-DD-YYYY");
就您而言,moment('Wed Dec 11 16:02:54 CET 2019', 'ddd MMM DD HH:mm:ss Z YYYY')
关于javascript - 如何从此字符串中获取日期 Wed Dec 11 16 :02:54 CET 2019,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59292132/