43 lines
979 B
Plaintext
Executable File
43 lines
979 B
Plaintext
Executable File
sub set_datetime_str
|
|
{
|
|
local ($wkstr) = $_[0];
|
|
local ($outStr) = "";
|
|
local ($fday, $fmon, $fyea, $fhou, $fmin, $fsec);
|
|
|
|
# format should be: `date "+%d-%m-%Y %H:%M:%S"`;
|
|
|
|
$fday=substr($wkstr,0,2);
|
|
$fmon=substr($wkstr,3,2);
|
|
$fyea=substr($wkstr,6,4);
|
|
$fhou=substr($wkstr,11,2);
|
|
$fmin=substr($wkstr,14,2);
|
|
$fsec=substr($wkstr,17,2);
|
|
|
|
# format for order criteria
|
|
|
|
$outStr=$fyea.$fmon.$fday.$fhou.$fmin.$fsec ;
|
|
return $outStr;
|
|
}
|
|
|
|
sub get_datetime_str
|
|
{
|
|
local ($wkstr) = $_[0];
|
|
local ($outStr) = "";
|
|
local ($fday, $fmon, $fyea, $fhou, $fmin, $fsec);
|
|
|
|
# format should be: `date "+%d-%m-%Y %H:%M:%S"`;
|
|
|
|
$fday=substr($wkstr,6,2);
|
|
$fmon=substr($wkstr,4,2);
|
|
$fyea=substr($wkstr,0,4);
|
|
$fhou=substr($wkstr,8,2);
|
|
$fmin=substr($wkstr,10,2);
|
|
$fsec=substr($wkstr,12,2);
|
|
|
|
# format for order criteria
|
|
|
|
$outStr=$fday."-".$fmon."-".$fyea." ".$fhou.":".$fmin.":".$fsec ;
|
|
|
|
return $outStr;
|
|
}
|