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

6 lines
211 B
TypeScript
Raw Normal View History

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