Moment.js正在提供无尽的格式回应

时间:2015-06-11 17:52:25

标签: javascript time momentjs

我有两个时刻的对象:

> calEvent.start.format('YYYY-MM-DDTHH:mm')
"2015-06-11A11:00"
           ^
           A? what is that? i was expecting 'T'

> dateTime.startDT.format('YYYY-MM-DDTHH:mm')
"2015-06-11T11:00"
           ^
           This is correct one for me.

当我用相同的字符串格式化两个时刻对象时,它会给出不同的响应:

-- grabs top 2 descending by date
select top 2 distinctDates
from (
    -- gets the distinct dates between your date range
    select distinct convert(date, mydate) as distinctDates
    FROM events e
    where e.timestamp Between '01-Jun-15 11:14:40 AM' AND '11-Jun-15 11:14:40 AM'
) dt
order by distinctDates desc

我试图找出这些对象之间有什么不同,以及为什么moment.js将T转换为A.

0 个答案:

没有答案