Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 68 lines (57 sloc) 0.651 kB
4bfc42a @tj Initial commit
authored
1
2 # ms.sh
3
4 A tiny bash script to convert milliseconds to strings,
5 and strings to milliseconds.
6
7 ## Usage
8
9 ```
10 . ms.sh
11
12 ms <string>
13 ms_to_s <ms>
14 ```
15
16 ## String to milliseconds
17
18 ```sh
19 ms 1000
20 ms 1s
21 ms 1m
22 ms 1h
23 ms 1d
24 ms 1y
25 ms 10s
26 ms 5d
27 ```
28
29 ```
30 1000
31 1000
32 60000
33 3600000
34 86400000
35 31557600000
36 10000
37 432000000
38 ```
39
40 ## Milliseconds to string
41
42 ```sh
43 ms_to_s $(ms 500)
44 ms_to_s $(ms 1s)
45 ms_to_s $(ms 15s)
46 ms_to_s $(ms 25m)
47 ms_to_s $(ms 60m)
48 ms_to_s $(ms 1h)
49 ms_to_s $(ms 2h)
50 ms_to_s $(ms 1d)
51 ms_to_s $(ms 5d)
52 ms_to_s $(ms 1y)
53 ms_to_s $(ms 5y)
54 ```
55
56 ```
57 500 milliseconds
58 1 seconds
59 15 seconds
60 25 minutes
61 1 hours
62 1 hours
63 2 hours
64 1 days
65 5 days
66 1 years
67 5 years
68 ````
Something went wrong with that request. Please try again.