I write an application in PowerShell, and I want to convert seconds to date.
In C# there is an AddSeconds function that adds seconds to date. What function in PowerShell does a similar performance?
Well, since the .NET framework is right at your fingertips, you can do
$d1 = [System.DateTime]::Now
And then
$d2 = $d1.AddSeconds(30)
Get-Date then appears to be a wrapper to the DateTime object and the following would work well:
$d3 = Get-Date 23.10.2010 -Format dd.MM.yyyy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With