Fixes to usergetdate() ... looks OK now.

This commit is contained in:
martin 2002-06-11 04:04:45 +00:00
parent 10b0e476c1
commit d2d6171f7c

View File

@ -229,7 +229,19 @@ function usergetdate($date, $timezone=99) {
if (abs($timezone) > 12) {
return getdate($date);
}
return getdate($date - (int)($timezone * 3600));
//There is no gmgetdate so I have to fake it...
$date = $date + (int)($timezone * 3600);
$getdate["seconds"] = gmstrftime("%S", $date);
$getdate["minutes"] = gmstrftime("%M", $date);
$getdate["hours"] = gmstrftime("%H", $date);
$getdate["mday"] = gmstrftime("%d", $date);
$getdate["wday"] = gmstrftime("%u", $date);
$getdate["mon"] = gmstrftime("%m", $date);
$getdate["year"] = gmstrftime("%Y", $date);
$getdate["yday"] = gmstrftime("%j", $date);
$getdate["weekday"] = gmstrftime("%A", $date);
$getdate["month"] = gmstrftime("%B", $date);
return $getdate;
}
function usertime($date, $timezone=99) {
@ -252,10 +264,6 @@ function usergetmidnight($date, $timezone=99) {
global $USER;
if ($timezone == 99) {
$timezone = (float)$USER->timezone;
}
$userdate = usergetdate($date, $timezone);
$timemidnight = gmmktime (0, 0, 0, $userdate["mon"], $userdate["mday"], $userdate["year"]);
return usertime($timemidnight, $timezone); // Time of midnight of this user's day, in GMT