in-the-database-2/src/lib/format.ts

6 lines
207 B
TypeScript
Raw Normal View History

2020-09-02 13:12:05 +00:00
export function formatTime(date: Date) : string {
let hours = date.getUTCHours();
let minutes = date.getUTCMinutes();
return `${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes} UTC`;
}