save current DATE & TIME as a TXT File

mehargags

Contributor
Hi Freinds,
I want to make a windows BATCH file that can save Current Date & time inside a TXT file & save the TXT file as somename.txt.......

I checked many sites but din't get a clue how to save current DATE & TIME AS a TXT File..
Can u pls do this small code for me?? Im aware of the date & time Variables in batch but dunno how to create a tXT file from them..

Thx
 
Get the current time in wanted format in a variable

and this command in the batch file should work

Code:
echo time_variable>somename.txt

Alternative

Code:
date/t>somename.txt

time/t>>somename.txt

Cheers..

Reps appreciated !!
 
Back
Top