note 39059 added to ref.datetime
| From: | mam1411 at hotmail dot com | Date: | Thu, 15 Jan 2004 17:01:32 +0000 |
| Subject: | note 39059 added to ref.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63631@lists.php.net to get a copy of this message | ||
hi visualmind iam mohannad
see this code:
<?
// COPYRIGHT 2002 BY KHALED MAMDOUH www.vbzoom.com //
// Updated, and added Islamic names of months by Samir Greadly
// xushi at xushi dot homelinux dot org
function Hijri($GetDateFormat)
{
$TDays=round(strtotime($GetDateFormat)/(60*60*24));
$HYear=round($TDays/354.37419);
$Remain=$TDays-($HYear*354.37419);
$HMonths=round($Remain/29.531182);
$HDays=$Remain-($HMonths*29.531182);
$HYear=$HYear+1389;
$HMonths=$HMonths+10;
$HDays=$HDays+23;
if ($HDays>29.531188 and round($HDays)!=30)
{
$HMonths=$HMonths+1;
$HDays=Round($HDays-29.531182);
}
else
{
$HDays=Round($HDays);
}
if ($HMonths>12){$HMonths=$HMonths-12;$HYear=$HYear+1;}
$ResultDate="$HDays-$HMonths-$HYear";
$ResultDate="$ResultDate"."åÜ";
return $ResultDate;
}
function DateFormatDo($GetDateFormat,$DateFormat)
{
$Day=SubStr($GetDateFormat,8,2);
$Month=SubStr($GetDateFormat,5,2);
$Year=SubStr($GetDateFormat,0,4);
$ResultDate=@date ($DateFormat, mktime (0,0,0,$Month,$Day,$Year));
return $ResultDate;
}
// Get today's date
$today = date("Y-m-d");
// Date Format : YYYY-MM-DD
ECHO Hijri($today);
?>
(^_*)
----
Manual Page -- http://www.php.net/manual/en/ref.datetime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39059
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39059&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39059&report=yes
Search -- http://master.php.net/manage/user-notes.php