Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Date Format in Text file

$
0
0

Friends,

I am generating a file through some script and need to add the date in front of it. I used cmd command and created a batch file but the format is coming as test.txt_12272013 but it should be Test.txt_20131227   (YYYYMMDD)

ren c:\testt\testing.txt test_%date:~4,2%%date:~7,2%%date:~10,4%.txt

Could you guys please help


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>