creating file names with time and date?

Strictly for sharing scripts used in Digital Atmosphere and getting assistance from other users.
Post Reply
Posts: 34
Joined: Mon Apr 07, 2008 11:42 am

creating file names with time and date?

Post by edwoodza »

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

Junior Member
Posts: 2
Joined: Fri Feb 22, 2008 4:34 am

Post by mbsarwin »

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.


Posts: 34
Joined: Mon Apr 07, 2008 11:42 am

Post by edwoodza »

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

Wood Ant
Posts: 62
Joined: Mon Jan 26, 2004 4:33 pm
Location: Dorking, ENGLAND

Post by Wood Ant »

But I can not get this batch file to work.

Posts: 19
Joined: Wed Jan 11, 2006 6:27 pm

Create file names with date and time

Post by ianp »

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

Post Reply