$var1 = '06/10/2015 2:00 AM'
$var2 = ([DateTime]($var1)).addMinutes(15).ToString('mm/dd/yyyy hh:mm')
$var2
Current output - 15/10/2015 02:15
but I want - 06/10/2015 02:15
Use 'MM/dd/yyyy hh:mm'. Note the uppercase 'M' for months. Lowercase 'm' is for minutes. These are the .NET custom time format strings documented here.
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