Back to snippets
dayjs_typescript_basic_setup_current_date_format.ts
typescriptBasic setup and usage of Day.js in a TypeScript project to format the current date
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);