Глупость получается, взял отдельно проверил, всё правильно первая строка отрабатывает! А в целом в софте не работает, вот где я вызываю всё<?
#exit 0;
$service_type="ani_phone";
require "$CFG::BASE/bin/dateutils";
require "$CFG::BASE/bin/dbaccess";
$date_from_int = $date_from;
$date_till_int = $date_till;
$date_f = $date_from_int;
$date_t = $date_till_int;
$FULL_TIME_FORMAT_1 = $CFG::FULL_TIME_FORMAT.'.000';
$date_from_int=convert_date($date_from_int,"$CFG::DATE_FORMAT $CFG::FULL_TIME_FORMAT");
$date_till_int=convert_date($date_till_int,"DD.MM.YYYY HH24:MI:SS");
print "$date_t --- $date_till_int --- "$CFG::DATE_FORMAT $CFG::FULL_TIME_FORMAT"";
........................................................................
Вот кусок
require "$CFG::BASE/bin/dateutils";
sub convert_date {
my ($date,$DATE_FORMAT) =@_;
if($DATE_FORMAT eq 'DD.MM.YYYY') {
if($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)/ ){
return $3 . "-" . $2 . "-" . $1;
}
};
if($DATE_FORMAT eq 'YYYY-MM-DD') {
if($date =~ /(\d\d\d\d)\-(\d\d)\-(\d\d)/ ){
return $1 . "-" . $2 . "-" . $3;
}
};
if($DATE_FORMAT eq 'DD.MM.YYYY HH24') {
if($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)\ (\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":00";
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)/ ){
return $3 . "-" . $2 . "-" . $1;
}
};
if($DATE_FORMAT eq 'DD.MM.YYYY HH24:MI') {
if($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)\ (\d+)\:(\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":" . $5 ;
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)\ (\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":00";
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)/ ){
return $3 . "-" . $2 . "-" . $1;
}
};
if($DATE_FORMAT eq 'DD.MM.YYYY HH24:MI:SS') {
if($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)(\s)(\d+)\:(\d+)\:(\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":" . $5 . ":" . $6;
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)\ (\d+)\:(\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":" . $5;
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)\ (\d+)/ ){
return $3 . "-" . $2 . "-" . $1 . " " . $4 . ":00";
} elsif($date =~ /(\d\d)\.(\d\d)\.(\d\d\d\d)/ ){
return $3 . "-" . $2 . "-" . $1;
}
};
return undef;
}
Чаго не так не врублюсь!