19 lines
362 B
JavaScript
19 lines
362 B
JavaScript
function datetime_to_local(input) {
|
|
const local_datetime = new Date(input);
|
|
|
|
return {
|
|
long: local_datetime.toLocaleString("en-US", {
|
|
year: "numeric",
|
|
month: "long",
|
|
day: "numeric",
|
|
hour: "2-digit",
|
|
minute: "2-digit",
|
|
hour12: true,
|
|
}),
|
|
|
|
short: local_datetime.toLocaleString("en-US", {
|
|
timeStyle: "short",
|
|
hour12: true,
|
|
}),
|
|
};
|
|
}
|