From 4600d73b0338fc035c96002e526220d7a593e96b Mon Sep 17 00:00:00 2001 From: nveid <nveid@ispconfig3> Date: Sat, 27 Aug 2011 23:34:22 -0400 Subject: [PATCH] This file is auto-generated by a template upon installation... Doesn't need to be in the repo here --- interface/lib/classes/remoting_lib.inc.php | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index ecd71bf..11b2449 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -325,10 +325,18 @@ break; case 'DATE': if($record[$key] != '' && $record[$key] != '0000-00-00') { - list($tag,$monat,$jahr) = explode('.',$record[$key]); - $new_record[$key] = $jahr.'-'.$monat.'-'.$tag; - //$tmp = strptime($record[$key],$this->dateformat); - //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; + if(function_exists('date_parse_from_format')) { + $date_parts = date_parse_from_format($this->dateformat,$record[$key]); + //list($tag,$monat,$jahr) = explode('.',$record[$key]); + $new_record[$key] = $date_parts['year'].'-'.$date_parts['month'].'-'.$date_parts['day']; + //$tmp = strptime($record[$key],$this->dateformat); + //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; + } else { + //$tmp = strptime($record[$key],$this->dateformat); + //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; + $tmp = strtotime($record[$key]); + $new_record[$key] = date('Y-m-d',$tmp); + } } else { $new_record[$key] = '0000-00-00'; } -- Gitblit v1.9.1