< Back

ConvertTo-DateTime

Thu Jan 16, 2020 9:56 am

NAME ConvertTo-DateTime



SYNOPSIS

Converts a string into a datetime





SYNTAX

ConvertTo-DateTime [-InputObject] <PSObject> [<CommonParameters>]





DESCRIPTION

If the InputObject is a string, it'll be converted into a DateTime.

But if it is a DateTime, it wont be touched. It just will be passed through.



This is needed to make this library compatible for Powershell 5.

Powershell 6 automatically recognizes DateTimes and converts them from the

kanbanflow format into normal DateTimes. But Powershell 5 does not.





PARAMETERS

-InputObject <PSObject>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>"2019-02-28T00:00:00Z" | ConvertTo-DateTime















RELATED LINKS