原文地址:http://app.en25.com/e/es.aspx?s=1403&e=5491&elq=8184bb918aa3406299da2caa939745da

原文:

A time span represents a time interval, and you can use time spans to subtract or add time to a date. For example, to get the date seven days ago:

PS> (Get-Date) - (New-Timespan -day 7)

 

翻译:

时间差代表时间上的间隔,你可以使用时间差来对一个指定时间进行加法和减法运算。比如,获得七天之前的日期:

PS> (Get-Date) - (New-Timespan -day 7)

 

 

笔记:

这里是powershell的写法,等同于c#下的adddays了。

相关文章:

  • 2022-02-09
  • 2022-01-21
  • 2021-11-14
  • 2021-10-11
  • 2021-09-26
  • 2021-08-19
  • 2021-07-15
  • 2021-07-12
猜你喜欢
  • 2021-09-22
  • 2021-11-18
  • 2022-02-02
  • 2021-12-12
  • 2022-01-16
  • 2022-02-22
  • 2021-12-03
相关资源
相似解决方案