formatting dir as date

jam13

  • Joined: Nov 14, 2011
  • Posts: 6

Thu 12/1/2011 - 1:44

I need to create a folder each day based on the datetime and am creating a folder using this as its name

 

%CurrentDateTime.Year%%CurrentDateTime.Month%%CurrentDateTime.Day%

 

 

 

e.g

 

mydir/20111128

mydir/20111129

 

BUT when I get to start of month I now get

 

mydir/20111121

 

I need

 

mydir/201111201

 

is it possible to do this ?

#1

ChrisK

  • Joined: Dec 30, 2010
  • Posts: 95

Thu 12/1/2011 - 4:24

You should have something more a long the lines of this:

1. Get Current Date and Time - saves to %CurrentDateTime%

2. Convert DateTime to Text - make sure to choose custom in the "Format to Use" and then in Custom Format put in: yyyyMMdd

3. Create Folder %FormattedDateTime% into C:\mydir

#2

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2326

Thu 12/1/2011 - 12:19

You can also check out the following blog post: http://www.winautomation.com/blog/clean-your-active-desktop-all-your-files-and-folders-daily-basis-creating-archive where the same logic is being used. :) Samantha

#3

jam13

  • Joined: Nov 14, 2011
  • Posts: 6

Thu 12/1/2011 - 20:50

chairs works

#4
Not a member yet? Register

Copyright 2013 - Softomotive Ltd