useDateFormat

Get the formatted date according to the string of tokens passed in, inspired by dayjs .

Clipboard.vue
<script setup>
  import { useDateFormat, useNow } from '@vueuse/core'
  const dateTime = useDateFormat(useNow(), 'dddd, MMM Do YYYY hh:mm:ss A')
</script>

<template>
  <span>
    {{ dateTime }}
  </span>
</template>
Sunday, Jul 14th 2024 12:46:38 PM