1
我试图将文件的修改日期与特定日期进行比较。比较修改日期与特定日期(VBS)
什么我是这样的:
If FormatDateTime(objFile.DateLastModified,vbShortDate) = specificDate Then
'Do something
End if
我使用则IsDate与#11/9 /到2015年#值的变量尝试,但始终返回false。我无法弄清楚如何将变量“specificDate”设置为11/9/2015。
您不想使用'FormatDateTime()'比较'Date',因为该函数会根据您指定的格式生成日期的字符串表示形式。只比较'Date'变量只能在比较中使用'objFile.DateLastModified'。 – Lankymart
这里有一些有用的信息 - http://stackoverflow.com/questions/16078043/vbs-objfile-datelastmodified-and-date-format-settings – Lankymart