in reply to Directory creation with current Date
use POSIX qw(strftime); $parent_dir = "c:\\backups"; $formatted_date = strftime("%d-%B-%Y", localtime); mkdir("$parent_dir/$formatted_date") or die("...: $!");
You might want to go with a format that's string-sortable, like YYYY-MM-DD:
$formatted_date = strftime("%Y-%m-%d", localtime); # YYYY-MM-DD $formatted_date = strftime("%F", localtime); # Same as prev line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Directory creation with current Date
by ZlR (Chaplain) on Jan 19, 2005 at 08:21 UTC | |
by demerphq (Chancellor) on Jan 19, 2005 at 15:28 UTC | |
by ZlR (Chaplain) on Jan 19, 2005 at 20:23 UTC | |
by demerphq (Chancellor) on Jan 19, 2005 at 21:20 UTC | |
by ZlR (Chaplain) on Jan 19, 2005 at 22:19 UTC | |
| |
|
Re^2: Directory creation with current Date
by PhilHibbs (Hermit) on Jan 20, 2005 at 13:54 UTC |