vbXMLRPC needs a slightly different dateformat.

This commit is contained in:
Carsten Wolff 2004-08-03 16:09:27 +00:00
parent d847c0e125
commit 00ce9a3181
2 changed files with 13 additions and 2 deletions

View File

@ -27,9 +27,19 @@
{
if (!is_array($date))
{
if(strstr($_SERVER['HTTP_USER_AGENT'],"vbXMLRPC"))
{
return date('Ymd\TH:i:s',$date);
}
return date('Y-m-d\TH:i:s',$date);
}
return sprintf('%04d-%02d-%02dT%02d:%02d:%02d',
$formatstring = "%04d-%02d-%02dT%02d:%02d:%02d";
if(strstr($_SERVER['HTTP_USER_AGENT'],"vbXMLRPC"))
{
$formatstring = "%04d%02d%02dT%02d:%02d:%02d";
}
return sprintf($formatstring,
$date['year'],$date['month'],$date['mday'],
$date['hour'],$date['min'],$date['sec']);
}

View File

@ -237,7 +237,8 @@
}
$_type = (is_integer($_res) ? 'int' : gettype($_res));
if ($_type == 'string' && ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res))
if ($_type == 'string' && (ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res)
|| ereg('^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) ) )
{
$_type = 'dateTime.iso8601';
}