# Date and Time

The `New-UDDateTime` component is used for formatting dates and times within the client's browser. By using the client's browser, you can format the time based on the local time zone and locale settings for the user.

The date and time component uses DayJS. For a full list of custom formatting options, visit the [DayJS documentation](https://day.js.org/docs/en/display/format).

## Basic Formatting

By default, the date and time will be formatted using the `LLL` localized formatting template.

```powershell
New-UDDateTime -InputObject (Get-Date)
```

Resulting output: August 16, 2018 8:02 PM

## Custom Formatting

You can specify custom formatting strings using the [DayJS formatting template](https://day.js.org/docs/en/display/format).

```powershell
New-UDDateTime -InputObject (Get-Date) -Format 'DD/MM/YYYY'
```

Resulting output: 25/01/2019

## API

[**New-UDDateTime**](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/New-UDDateTime.txt)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powershelluniversal.com/master-1/userinterfaces/dashboards/components/data-display/date-and-time.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
