2
0
forked from Wavyzz/dolibarr

Retour arriere. Toutes les dates dans les proprits des objets date doivent etre stockes au format timestamp et non au format caractre qui est inexploitable avec les fonctions dates, tri, etc...

Suppression des exception  afin de garantir une uniformit du code.
This commit is contained in:
Laurent Destailleur
2007-01-16 22:02:36 +00:00
parent bb32e1db48
commit a0149a378e
6 changed files with 48 additions and 35 deletions

View File

@@ -520,7 +520,8 @@ function dolibarr_print_date($time,$format='')
{
// Le formatage ne peut etre appliqu<71> car windows ne supporte pas la fonction
// mktime si l'ann<6E>e est inf<6E>rieur <20> 1970. On retourne un format fixe
return "$syear-$smonth-$sday";
// return "$syear-$smonth-$sday";
return strftime($format,dolibarr_mktime($shour,$smin,0,$smonth,$sday,$syear));
}
else
{
@@ -562,11 +563,18 @@ function dolibarr_stringtotime($string)
*/
function dolibarr_mktime($x,$y,$z,$month,$day,$year)
{
$montharray=array(1=>'january',2=>'february',3=>'march',4=>'april',5=>'may',6=>'june',
7=>'july',8=>'august',9=>'september',10=>'october',11=>'november',12=>'december');
if ($year <= 1970 && $_SERVER["WINDIR"])
{
// Gestion a faire pour windows
return 0;
// Sous Windows, mktime ne fonctionne pas quand ann<6E>e < 1970.
// On utilise strtotime pour obtenir la traduction.
$string=$day." ".$montharray[0+$month]." ".$year;
$date=strtotime($string);
//print "x".($month)."y".(0+$month)." ".$string." ".$date."e";
//print "eee".$db->idate($date);
return $date;
}
else
{