Getting Current time - 1 hour

April 13, 2011 at 16:23:25
Specs: Windows XP

Please pardon my lack of knowledge in this area.

I am looking to preform a check on remote systems that takes the current time in HH:MM AM/PM format - 1 hour and tell me if there are any files in the directory i am looking in that match the time frame of now - 1 hour.

I am currently using
@echo off
echo/|set /p =%date% >time.txt
time /t >>time.txt
to get my date and time.

The problem that i have is setting the time and date as a variable and then finding that variable in a directory.

I am just preforming a dir {path} > %log% and then want to find out if a file has updated or not in the past 1 - 2 hours of run time... I am trying to perform this in over 2000 environments.

See More: Getting Current time - 1 hour

Report •

April 13, 2011 at 17:17:32
You are assuming all the environments have the same date and time formats.

Report •

April 13, 2011 at 17:45:55
I know that when a dir is issued the response is in MM/DD/YYYY HH:MM AM/PM format.

I also know that when you hit a remote device it is showing you the time of where you are running the script...

IE if i run a dir on an EST location from a PST location the resulting date and time is translated into PST data. AKA -3 hours.

Report •
Related Solutions

Ask Question