Converts a DateTime object to a Unix timestamp.
Converts a DateTime object to a Unix timestamp.
The DateTime object to convert.
Type: DateTime
Mandatory: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
ConvertTo-UnixTimestamp -DateTime (Get-Date)Example output:
1752252878823
- PowerShell 7.0+