UNPKG
vremel
Version:
latest (0.6.2)
0.6.2
0.6.1
0.6.0
0.5.1
0.5.0
0.4.0
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
JavaScript date utility library for Temporal API
github.com/fabon-f/vremel
fabon-f/vremel
vremel
/
src
/
datetime
/
_secondsToHms.ts
10 lines
(9 loc)
•
277 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
/**
@internal
*/
export
function
secondsToHms
(
sec
:
number
,
): [
hour
:
number
,
minute
:
number
,
second
:
number
] {
const
second = sec -
Math
.
floor
(sec /
60
) *
60
;
const
minute =
Math
.
floor
(sec /
60
) %
60
;
const
hour =
Math
.
floor
(sec /
3600
);
return
[hour, minute, second]; }