Skip to content

Commit dd1d916

Browse files
Updated readme
1 parent 72683cb commit dd1d916

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use TimelyDiff, you need to require it in your JavaScript file:
1515
```javascript
1616
import { timelydiff } from 'timelydiff';
1717
```
18-
Once you've required the function, you can use it to convert a Unix timestamp into a human-readable time difference:
18+
Once you've imported the function, you can use it to convert a Unix timestamp into a human-readable time difference:
1919
```javascript
2020
const timestamp = 1708868951000; // February 25th, 2024 08:24:36 AM UTC
2121
const timeDiff = timelydiff(timestamp);
@@ -25,7 +25,7 @@ const timestamp2 = 1667499433271;
2525
console.log(timelydiff(timestamp2)); // "4 months ago"
2626
```
2727

28-
> To generate a timestamp at the current moment and store it for later use, you can use the built-in JavaScript function Date.now(), which returns the number of milliseconds since January 1, 1970, 00:00:00 UTC (Unix timestamp).
28+
> To generate a timestamp at the current moment and store it for later use, you can use the built-in JavaScript function **Date.now()**, which returns the number of milliseconds since January 1, 1970, 00:00:00 UTC (Unix timestamp).
2929
<br>
3030
3131
Optionally, you can pass a second parameter to the function to specify the length of the output string. By default, the function will return a string in the format of x [unit] ago/in [x] [unit], but you can choose to return a shorter string by setting the length parameter to "short" or "shorter".

0 commit comments

Comments
 (0)