Home > Enterprise >  How to convert date and obtain new date with timezone in composiiton api by using @nuxtjs/dayjs?
How to convert date and obtain new date with timezone in composiiton api by using @nuxtjs/dayjs?

Time:04-16

I use @nuxtjs/dayjs in my nuxt-composiiton api project . I need to convert my date and i neeed to obtain new date with timezone

2022-04-11T15:13:00.000Z ----> 2022-04-11T15:13:00 03:00

  const { $dayjs } = useContext();
  const date='2022-04-11T15:13:00.000Z'

  dayjs usage in composition api => $dayjs(date).format('') .....

CodePudding user response:

https://day.js.org/docs/en/parse/string-format

console.log(' $dayjs ', $dayjs(date).format('YYYY-MM-DDTHH:mm:ss Z'));

  • Related