-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
hello shows someone how I can add the 24 hour format or would like to remove am and pm need help with please
function formatDateTime(date) {
var now = new Date();
var zpad_mins = ':' + (date.getMinutes() < 10 ? '0' : '') + date.getMinutes();
if (date.getYear() != now.getYear()) {
return '' + (1900 + date.getYear());
} else if ((date.getMonth() != now.getMonth()) ||
(date.getDate() != now.getDate())) {
return date.getDate() + ' ' + chrome.i18n.getMessage(
'month' + date.getMonth() + 'abbr');
} else if (date.getHours() == 12) {
return '12' + zpad_mins + 'pm';
} else if (date.getHours() > 12) {
return (date.getHours() - 12) + zpad_mins + 'pm';
}
return date.getHours() + zpad_mins + 'am';
}
Metadata
Metadata
Assignees
Labels
No labels