0

I need to extract the current date and time from the system and create SQL queries using a range of dates. As i am running this on Windows, it will have to be a dos batch script. Is there a way a can get the date and time in the DDMONYY,HH:MI:SS format? (e.g. 14MAR11,14:25:26)

I would like to generate ten dates in that format with each being 1 minute later than the previous date and time.

I am not an expert in dos scripting but i have found out how to write a loop in dos but not quite sure how to generate the date in the format i want it to be:

for /L %%i in (1,1,10) do (

    currentDate = currentDate + one minute
    echo "Insert into dateValue(ArrivalDates) values(%currentDate%)" > insert%i%.sql

)

Thanks in advance

ziggy
  • 15,319
  • 64
  • 187
  • 280

0 Answers0