UNPKG
hn-ts
Version:
latest (0.1.0)
0.1.0
TypeScript client for the Hacker News API
github.com/velut/hn-ts
velut/hn-ts
hn-ts
/
src
/
unix-to-iso-string.ts
5 lines
(4 loc)
•
198 B
text/typescript
View Raw
1
2
3
4
5
/** `unixToIsoString` converts a time in Unix seconds to a UTC ISO timestamp */
export
function
unixToIsoString
(
{ time }: { time:
number
}
):
string
{
return
new
Date
(time *
1000
).
toISOString
(); }