useFormatDateTime

useFormatDateTime is a custom hook for formatting date time.

10/20/2025

Usage

import { useFormatDateTime } from "@yamada-ui/react"
const formattedValue = useFormatDateTime(new Date())

It formats date time according to the specified locale and options. The hook returns the formatted value directly.

Changing the Locale

To change the locale, set a value for locale.

en-US

10/20/2025

ja-JP

2025/10/20

de-DE

20.10.2025

fr-FR

20/10/2025

zh-CN

2025/10/20

Set the Locale for the Entire Application

If you want to set the locale for the entire application, set the locale for the UIProvider.

import { UIProvider } from "@yamada-ui/react"

const App = () => {
  return (
    <UIProvider locale="en-US">
      <YourComponent />
    </UIProvider>
  )
}

Converting to Year

To convert to year, set a value for year.

2025

Converting to Month

To convert to month, set a value for month.

October

Converting to Day

To convert to day, set a value for day.

20

Converting to Weekday

To convert to weekday, set a value for weekday.

Monday