Skip to content

ConvertTo-LexicalTimespan

SYNOPSIS

Convert a timespan to lexical time.

SYNTAX

ConvertTo-LexicalTimespan [-Timespan] <TimeSpan> [<CommonParameters>]

DESCRIPTION

Convert a timespan into a lexical version that you can insert into an XML document.

EXAMPLES

Example 1

PS C:\> ConvertTo-LexicalTimespan (New-Timespan -Days 7)

P7D

You can insert this value into an XML document where you need to represent a time-span.

PARAMETERS

-Timespan

Enter a timespan object

Type: System.TimeSpan
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
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

System.TimeSpan

OUTPUTS

String

NOTES

Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/

ConvertFrom-LexicalTimespan

Back to top