MCPcopy Create free account
hub / github.com/deta/surf / getFormattedTime

Function getFormattedTime

packages/utils/src/data/time.ts:71–75  ·  view source on GitHub ↗
(timestamp: number | string, exact = true)

Source from the content-addressed store, hash-verified

69}
70
71export const getFormattedTime = (timestamp: number | string, exact = true) => {
72 const ms = typeof timestamp === 'string' ? new Date(timestamp).getTime() : timestamp
73
74 return format(ms, exact ? 'HH:mm:ss.SSS' : 'HH:mm')
75}
76
77export const getFormattedDate = (timestamp: number | string) => {
78 const ms = typeof timestamp === 'string' ? new Date(timestamp).getTime() : timestamp

Callers 1

getHumanFormattedDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected