var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: batch file with dates
I want to run a batch file that contains (copy ,other commands) on window 2000
that batch file should run at 2 am it gets the system date (month and day)-1
meaning previos day
(jan23rd) and join with a batch file myfile 122 (on windows 2000)
and for oct should be A22, noV should be B22 AND
DEC Should be C22
real catch is on 1st feb should be 131(jan 31st) etc for each month
= localtime(time() - 86400);
$filename = sprintf("%X%02d", 1 + $mon, $mday);
Hi Pat Phelan,
I'm trying to get my date and time in the format (dd/mm/yyyy hh:mm:ss)
below is my code, can you advise on what is wrong with it?
$time = localtime;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isd st) = localtime($time);
print "<BR>$mday/$mon/$year $hour:$min:$sec<BR>";
and my output turn up to be "1/0/70 8:0:0", which is not what I want.
Also as I'm a newbie in perl, can you advise on some websites which I can refer to.
ps: By the way why minus 86400?
Originally Posted by
Something seems to be kind of confused with your year, but I'd use:
At least in most implementations of localtime(), Months are 0 - 11 and years are relative to 1900, so I added the appropriate offset values.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
$formatted_time = sprintf("<BR>%02d/%02d/%04d %02d:%02d:%02d<BR>"
, $mday, 1 + $mon, 1900 + $year, $hour, $min, $sec);
There are 86400 seconds in a standard day (24 hours times 60 minutes times 60 seconds). The time() function returns the seconds since the epoch, and the localtime function mangles the seconds into more conventional units of time. By subtracting 86400 seconds from the current time, I "back up" one day to get yesterday's date as sjumma requested.