Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ console.log(timestamp.utc());
//=> 2018-10-26
```

or in typescript:

```ts
import timestamp = require('time-stamp');

console.log(timestamp());
//=> 2018-10-26

console.log(timestamp.utc());
//=> 2018-10-26
```

## Customizing the timestamp

You may also pass a string to format the generated timestamp.
Expand Down
9 changes: 5 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare function timestamp(pattern?: string | Date, date?: Date): string
declare function timestampUTC(pattern?: string | Date, date?: Date): string
declare function timestamp(pattern?: string | Date, date?: Date): string;

export default timestamp
export { timestampUTC as utc };
declare namespace timestamp {
function utc(pattern?: string | Date, date?: Date): string;
}
export = timestamp;