Home > Net >  How can i add minutes to a date in Powershell?
How can i add minutes to a date in Powershell?

Time:11-19

I use the following:

  --start-time $(date -u  "%Y-%m-%dT%H:%M:%SZ") --end-time $(date -u  "%Y-%m- 
        %dT%H:%M:%SZ")

So the end and start time are the same. I want to make the endtime 5minutes more that the start time. How can i do this ?

CodePudding user response:

To add minutes in powershell

$date = Get-Date #current Date and time
$addminutes = (Get-Date).AddMinutes(5) # adding 5 minutes to current date and time
  • Related