1.0.12 • Published 2 years ago

ld-parse-ms v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ld-parse-ms

Examples function parseMilliseconds

const { parseMilliseconds } = require("ld-parse-ms");

parseMilliseconds(1234567890);
// return { years: 0, months: 0, weeks: 2, days: 0, hours: 6, minutes: 56, seconds: 7, milliseconds: 890 }

parseMilliseconds(1234567890, ["hours", "minutes", "seconds"]);
// return { hours: 6, minutes: 56, seconds: 7 }

Examples function formatTime

const { formatTime } = require("ld-parse-ms")

formatTime(1234567890, false)
// return "0г. 0мес. 2н. 0д. 6ч. 56мин. 7сек. 890мс."

formatTime(1234567890, true, ["minutes", "seconds"])
// return "`56мин.` `7сек.`"

Examples function formattingDiscordTimestamp

const { formattingsDiscordTimestamp } = require("ld-parse-ms")

formattingsDiscordTimestamp(1676064699727)
// return "<t:1676064699:f>"

formattingsDiscordTimestamp(1676064699727, "R")
// return "<t:1676064699:R>"

Style Timestamp

styleformat
"t"21:31
"T"21:31:39
"d"10/02/2023
"D"10 February 2023
"f"10 February 2023 21:31
"F"Friday, 10 February 2023 21:31
"R"3 hours ago
1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.0

2 years ago