PowerTip of the Day-Creating Time Spans

原文地址: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了。

posted @ 2010-07-09 09:11  哥本哈士奇(aspnetx)  阅读(317)  评论(0编辑  收藏  举报