> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/it/app/components/data-display/date-and-time.md).

# Data e ora

Il componente `New-UDDateTime` viene utilizzato per formattare date e orari all'interno del browser del client. Utilizzando il browser del client, è possibile formattare l'ora in base al fuso orario locale e alle impostazioni locali dell'utente.

{% hint style="warning" %}
L'output di `New-UDDateTime` non può essere utilizzato con componenti come `New-UDHtml`, `New-UDMarkdown` o `Show-UDToast`. L'oggetto restituito da `New-UDDateTime` deve eseguire JavaScript all'interno del browser e non è un vero oggetto DateTime.
{% endhint %}

Il componente data e ora utilizza DayJS. Per un elenco completo delle opzioni di formattazione personalizzate, consulti la [documentazione di DayJS](https://day.js.org/docs/en/display/format).

## Formattazione di base

Per impostazione predefinita, la data e l'ora verranno formattate utilizzando il modello di formattazione localizzato `LLL`.

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

Output risultante: August 16, 2018 8:02 PM

## Formattazione personalizzata

È possibile specificare stringhe di formattazione personalizzate utilizzando il [modello di formattazione DayJS](https://day.js.org/docs/en/display/format).

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

Output risultante: 25/01/2019

## Impostazioni locali

È possibile specificare le impostazioni locali con cui visualizzare la data e l'ora.

```powershell
New-UDDateTime -InputObject (Get-Date) -Locale 'es'
```

Output risultante: 13 de septiembre de 2022 7:30

## API

[**New-UDDateTime**](/powershell-universal/it/comandi-powershell/new-uddatetime.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/it/app/components/data-display/date-and-time.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
