using perl, how to print current Date and Time Of any specified TimeZone
- by dexter
i have done like:
my($sec,$min,$hour,$day,$month,$yr19,@rest)= localtime(time);
print "##########################" ;
print "\nDate:\t$day-".++$month. "-".($yr19+1900). "\n";
print "Time:\t".sprintf("%02d",$hour). ":".sprintf("%02d",$min). ":".sprintf("%02d",$sec)."\n";
it gives me wrong $day , $min and $sec
my timezone is IST,
is there any alternative to this ?