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

原文:

There are actually two different ways of manipulating dates and times. Here is the high-level approach to subtract 30 days from today:

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

And here is an example that  offers  a more developer-centric approach:

PS> (Get-Date).AddDays(-30)

 

 

翻译:

操作时间有两种不同的方法,以下方式是高级(?)实现从今天减30天的方法。

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

下面的方法则是开发人员用的更多的方法:

PS> (Get-Date).AddDays(-30)

 

 

笔记:

两种方法的不同实现,powershell的和.net的。

相关文章:

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