Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-UDDateTime

Synopsis

This date and time component is used for formatting dates and times using the user's browser settings.

Syntax

New-UDDateTime [-Id <String>] [[-InputObject] <DateTime>] [-LocalizedFormat <String>] [-Locale <String>] [<CommonParameters>]

New-UDDateTime [-Id <String>] [[-InputObject] <DateTime>] [-Format <String>] [-Locale <String>] [<CommonParameters>]

Description

This date and time component is used for formatting dates and times using the user's browser settings. Since Universal Dashboard PowerShell scripts run within the server, the date and time settings of the user's system are not taken into account. This component formats date and time within the client's browser to take into account their locale and time zone.

Parameters

-Id

The ID of this component.

Required?                    false
Position?                    named
Default value                [Guid]::NewGuid()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

-InputObject

The date and time object to format.

-Format

The format of the date and time. This component uses Day.JS. You can learn more about formatting options on their documentation: https://day.js.org/docs/en/display/format

-LocalizedFormat

The localized format for the date and time. Use this format if you would like to take the user's browser locale and time zone settings into account.

-Locale

The locale to use when formatting the date time. Defaults to not set.

Common parameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Outputs

Examples

Example 1

Formats a date and time using the format 'DD/MM/YYYY'

Example 2: Localized Format

Formats a date and time using the localized format 'LLL'

Example 3: Locale

Formats a date and time using the locale 'es'

Last updated

Was this helpful?