PowerShell compute interval (new-timespan)

Source: Internet
Author: User

In Windows PowerShell , the New-timespan cmdlet provides a way to do date arithmetic .

    • Calculation time interval :

This command tells you the number of days between today's date and 2006 New Year's Eve:

New-timespan $ (get-date) $ (get-date–month 12-day 31-year 2006) New-timespan $ (get-date) $ (get-date–month 12-d Ay 31-year 2006-hour 23-minute 30)

Calculated from 2013/11/11 to 520 days is that day?

(get-date 2013/11/11) + (New-timespan-day 5200:00:00
(get-date)-(new-timespan-day 44814:51:10

PowerShell compute interval (new-timespan)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.