Date 通过日期的测试

Date 通过日期的测试,date,batch-file,Date,Batch File,我有一个批处理文件,需要查看设置的日期是否已过 例如: ::The set date is in a file Date.txt ::Format is mm\dd\yy for /f %%d in (date.txt) do ( set date_fixed=%%d ) [do condition to see if todays date is greater than the set date] Date.txt的内容是:06/03/2015我建议始终使用ISO-86

我有一个批处理文件,需要查看设置的日期是否已过

例如:

 ::The set date is in a file Date.txt
 ::Format is mm\dd\yy
 for /f %%d in (date.txt) do (
 set date_fixed=%%d
     )
 [do condition to see if todays date is greater than the set date]

Date.txt的内容是:06/03/2015

我建议始终使用ISO-8601日期格式。它更易于使用,甚至可以在不进行更改的情况下进行排序。为了获得当前日期,我将使用可能重复的类似问题中的gettimestamp.bat。询问前请使用搜索。