20 lines
No EOL
533 B
JavaScript
20 lines
No EOL
533 B
JavaScript
function formatTime(ms) {
|
|
const totalSeconds = Math.floor(ms / 1000);
|
|
const minutes = Math.floor(totalSeconds / 60);
|
|
const seconds = totalSeconds % 60;
|
|
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
}
|
|
|
|
function formatDateTime(ms) {
|
|
const date = new Date(ms);
|
|
const options = {
|
|
month: 'long',
|
|
day: 'numeric',
|
|
year: 'numeric',
|
|
hour: 'numeric',
|
|
minute: '2-digit',
|
|
hour12: true,
|
|
timeZone: 'America/Chicago'
|
|
};
|
|
return `Logged at:<br>${date.toLocaleString('en-US', options)} CST`;
|
|
} |