Skip to main content

Get-UniversalDate

SYNOPSISโ€‹

Returns the date/time for the local culture in a universal sortable date time pattern.

SYNTAXโ€‹

Get-UniversalDate [[-DateTime] <String>] [[-ContinueOnError] <Boolean>] [<CommonParameters>]

DESCRIPTIONโ€‹

Converts the current datetime or a datetime string for the current culture into a universal sortable date time pattern, e.g. 2013-08-22 11:51:52Z

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Get-UniversalDate

Returns the current date in a universal sortable date time pattern.

EXAMPLE 2โ€‹

Get-UniversalDate -DateTime '25/08/2013'

Returns the date for the current culture in a universal sortable date time pattern.

PARAMETERSโ€‹

-DateTimeโ€‹

Specify the DateTime in the current culture.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: ((Get-Date -Format ($culture).DateTimeFormat.UniversalDateTimePattern).ToString())
Accept pipeline input: False
Accept wildcard characters: False

-ContinueOnErrorโ€‹

Continue if an error is encountered. Default: $false.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

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

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

System.Stringโ€‹

Returns the date/time for the local culture in a universal sortable date time pattern.โ€‹

NOTESโ€‹

https://psappdeploytoolkit.com