Test Ar-PHP Functionality Online

header line!
Test PHP Function




























Ar-PHP Manual

method mktime [line 148]

integer mktime( integer $hour, integer $minute, integer $second, integer $hj_month, integer $hj_day, integer $hj_year, [integer $correction = 0])

This will return current Unix timestamp for given Hijri date (Islamic calendar)



Tags:

return:  Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
author:  Khaled Al-Sham'aa <khaled@ar-php.org>
access:  public


Parameters:

integer   $hour   Time hour
integer   $minute   Time minute
integer   $second   Time second
integer   $hj_month   Hijri month (Islamic calendar)
integer   $hj_day   Hijri day (Islamic calendar)
integer   $hj_year   Hijri year (Islamic calendar)
integer   $correction   To apply correction factor (+/- 1-2) to standard Hijri calendar

Example
  1.  date_default_timezone_set('UTC');
  2.  
  3.  include('./I18N/Arabic.php');
  4.  $obj new I18N_Arabic('Mktime');
  5.  
  6.  $time $obj->mktime(0,0,0,9,1,1427);
  7.  
  8.  echo "<p>Calculated first day of Ramadan 1427 unix timestamp is: $time</p>";
  9.  
  10.  $Gregorian = date('l F j, Y',$time);
  11.  
  12.  echo "<p>Which is $Gregorian in Gregorian calendar</p>";
Popular
Recent
Links
Ads!
footer line!

No Software Patents! General Public License

Home | Twitter | Blog | Contact

Copyright © 2006 - 2016 Khaled Al-Sham'aa