The Weather Forecasting Forum
http://www.weathergraphics.com/forum/

creating file names with time and date?
http://www.weathergraphics.com/forum/viewtopic.php?f=9&t=1424
Page 1 of 1

Author:  edwoodza [ Fri Aug 22, 2008 9:04 am ]
Post subject:  creating file names with time and date?

can anyone tell me how to script it so it saves the chart with a file name like:
winds(year)(month)(day)(hour).gif
otherwise i have to create a script for each hour and tell it to save the file name.....

Author:  mbsarwin [ Sat Aug 23, 2008 9:50 am ]
Post subject: 

hi,
you can use this example to try out what you want to do.

i have used it successfuly to make copy the downladed files with date and time to do the archival.

@echo off
rem rename syn.dat With Name Date and Time
for /f "tokens=2-4 delims=/- " %%a in ('date /t') do set XDate=%%a-%%b-%%c
for /f "tokens=1-2 delims=: " %%a in ('time /t') do set XTime=%%a-%%b
copy c:\digatmos\data\syn.dat c:\digatmos\data\%XDate%%XTime%_syn.dat
copy c:\digatmos\data\fsusyn.dat c:\digatmos\data\%XDate%%XTime%_fsusyn.dat
copy c:\digatmos\data\albanyboy.dat c:\digatmos\data\%XDate%%XTime%_albanyboy.dat
copy c:\digatmos\data\codupa.dat c:\digatmos\data\%XDate%%XTime%_codupa.dat

copy command copies the .dat files with date time suffix.

cheers
Bala.

Author:  edwoodza [ Sat Aug 23, 2008 1:55 pm ]
Post subject: 

hi
how can i get it save the time on 24 hour format?

Author:  Wood Ant [ Sun Aug 24, 2008 9:06 pm ]
Post subject: 

Sorry,
But I can not get this batch file to work.

Author:  ianp [ Thu Aug 28, 2008 8:30 pm ]
Post subject:  Create file names with date and time

I use a script for each hour I want a plot
with the following:

# write map to gif file
EXPORT,F:\program files\DigAtmEquinox\archive\@FFZ@MMZ@DDZ12.gif

you could add any name along with the @FFZ etc. I've just added 12 for 12:00 in this example

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/