I am trying to convert to some date format from the below hash output. I am in need of convert many hash output to this date format below. I am using this below code now. it seems this code is not proper way I used.
Please share your thoughts to get that time format as simple way from the each hash output
my $status_update_time = "$row->{'update_time'}";
$status_update_time =~ m/(d{4})-(d{2})-(d{2}) (d{2}):(d{2}):(d{2})$/;
my ($year, $month, $date,$hours,$minute,$second) = ($1, $2, $3, $4, $5, $6);
my $date_time = "$1-$2-$3T$4:$5:$6TZ"; #2015-08-11T04:31:41Z# expecting this time output
my $next_check = "$row->{'next_check'}";
$next_check =~ m/(d{4})-(d{2})-(d{2}) (d{2}):(d{2}):(d{2})$/;
my ($year, $month, $date,$hours,$minute,$second) = ($1, $2, $3, $4, $5, $6);
my $next_check_time = "$1-$2-$3T$4:$5:$6Z"; #2015-08-11T04:31:41Z# expecting this time output
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…