PowerTip of the Day-Adding and Subtracting Time
原文地址: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的。
---------------------------------------------------------------
aspnetx的BI笔记系列索引:
使用SQL Server Analysis Services数据挖掘的关联规则实现商品推荐功能
---------------------------------------------------------------
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步