Saved Bookmarks
| 1. |
Solve : Expiry date...? |
|
Answer» Hi... NEWBIE here. @echo offQuote Hi... Newbie here. sorry... i tested, only the DAY can work... Your code certainly doesn't look like it's running on a MS-DOS machine. In any case when dealing with date comparisons, it is advisable to have them formatted YYYYMMDD. Code: [Select] for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set today=%%c%%a%%b if "%today%" leq "20051211" ( GOTO 1 ) ELSE ( GOTO 2 ) I couldn't tell if your date format is MM/DD/YYYY or DD/MM/YYYY. If I goofed it, reverse the %%a and %%b variables at the end of the first line. Hope this helps. Quote Your code certainly doesn't look like it's running on a MS-DOS machine. In any case when dealing with date comparisons, it is advisable to have them formatted YYYYMMDD. ya Sidewinder, i already got the solution and it is actually the same as what u have quoted. But i still dun understand how the below function work... "for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set today=%%c%%a%%b" Thank a lot pal... |
|