Advertisement
Guest User

format DOS output with today's date anyway you want, easiest

a guest
Jul 5th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. up vote
  2. 2
  3. down vote
  4.    
  5.  
  6. You can also access the date via the variable %DATE%
  7.  
  8. When testing my system %DATE% produces dd/mm/yyyy
  9.  
  10. you can use substring operators to produce the format you desire
  11.  
  12. ie
  13.  
  14. %DATE:~3,2%%DATE:~0,2%%DATE:~6,4%
  15.  
  16. the substring argumenst are
  17. %*variable*:~*startpos*,*numberofchars*%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement