如何获取和显示昨天的日期? [英] How to get and display yesterday date?
问题描述
我使用的日期命令批处理脚本。结果
我想知道如何使用命令的日期以获得迄今为止昨天
I am using the date command for a batch script.
I am wondering how to use command date to get yesterday date.
推荐答案
看着@ JRL的<一个href=\"http://stackoverflow.com/questions/2954359/dos-batch-programming-howto-get-and-display-yesterday-date/2954377#2954377\">answer...如果是真的那么难,或者使用PowerShell的,然后做类似<一个href=\"http://stackoverflow.com/questions/2433941/powershells-get-date-how-to-get-yesterday-at-2200-in-a-variable\">http://stackoverflow.com/questions/2433941/powershells-get-date-how-to-get-yesterday-at-2200-in-a-variable
Looking at @JRL's answer... If it's truly that hard, perhaps use PowerShell and then do similar to http://stackoverflow.com/questions/2433941/powershells-get-date-how-to-get-yesterday-at-2200-in-a-variable
您可以像这样一个bat文件调用的PowerShell:<一href=\"http://stackoverflow.com/questions/1804751/use-bat-to-start-powershell-script\">http://stackoverflow.com/questions/1804751/use-bat-to-start-powershell-script
You can call to PowerShell in a bat file like so: http://stackoverflow.com/questions/1804751/use-bat-to-start-powershell-script
您将有三个或四个衬垫的解决方案,而不是100或这么写的(一尘不染,我将添加)罗布范德Woude结束了。
You'll end up with a three or four liner solution rather than the 100 or so written (immaculately I'll add) by Rob Van der Woude.
好运...
这篇关于如何获取和显示昨天的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!