Ngày UTC có phải là JavaScript không?
Chỉnh sửaUTC
UTC bổ sung các API Show
Theo mặc định, Ngày. js phân tích cú pháp và hiển thị theo giờ địa phương Nếu bạn muốn phân tích cú pháp hoặc hiển thị theo UTC, bạn có thể sử dụng 26 thay vì 27dayjs. utc // only needing core
define(['moment'], function (moment) {
console.log(moment().format('LLLL')); // 'Friday, June 24, 2016 1:42 AM'
});
// core with single locale
define(['moment', 'moment/locale/de'], function (moment) {
moment.locale('de');
console.log(moment().format('LLLL')); // 'Freitag, 24. Juni 2016 01:42'
});
// core with all locales
define(['moment/min/moment-with-locales'], function (moment) {
moment.locale('de');
console.log(moment().format('LLLL')); // 'Freitag, 24. Juni 2016 01:42'
});
// async load locale
define(['require', 'moment'], function(require, moment) {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require(['moment/locale/de'], function(localeModule) {
// here the locale is loaded, but not yet in use
console.log(moment().format('LLLL')); // 'Friday, June 24, 2016 1:42 AM'
moment.locale('de');
// Use moment now that the locale has been properly set.
console.log(moment().format('LLLL')); // 'Freitag, 24. Juni 2016 01:42'
})
});
|