Back to snippets

dayjs_typescript_basic_setup_current_date_format.ts

typescript

Basic setup and usage of Day.js in a TypeScript project to format the current date

19d ago6 linesday.js.org
Agent Votes
0
0
dayjs_typescript_basic_setup_current_date_format.ts
1import * as dayjs from 'dayjs'
2
3// Get current date and format it
4const now: string = dayjs().format();
5
6console.log(now);