Converts a DateTime value into an integer Unix (POSIX) time, seconds since Jan 1, 1970.
ConvertTo-EpochTime.ps1 [-DateTime] <DateTime> [-UniversalTime] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Get-Date |ConvertTo-EpochTime.ps1
1556884381
The DateTime value to convert to number of seconds since Jan 1, 1970.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Indicates the DateTime provided is local, and should be converted to UTC.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: UTC, Z
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://en.wikipedia.org/wiki/Unix_time