Test Ar-PHP Functionality Online

header line!
Test PHP Function
















Ar-PHP Manual

method date [line 240]

string date( string $format, integer $timestamp, [integer $correction = 0])

Format a local time/date in Arabic string



Tags:

return:  Format Arabic date string according to given format string using the given integer timestamp or the current local time if no timestamp is given.
author:  Khaled Al-Sham'aa <khaled@ar-php.org>
access:  public


Parameters:

string   $format   Format string (same as PHP date function)
integer   $timestamp   Unix timestamp
integer   $correction   To apply correction factor (+/- 1-2) to standard hijri calendar

Example
  1.    date_default_timezone_set('UTC');
  2.    $time = time();
  3.  
  4.    echo date('l dS F Y h:i:s A'$time);
  5.    echo '<br /><br />';
  6.  
  7.    include('./I18N/Arabic.php');
  8.    $obj new I18N_Arabic('Date');
  9.  
  10.    echo $obj->date('l dS F Y h:i:s A'$time);
  11.    echo '<br /><br />';
  12.  
  13.    $obj->setMode(2);
  14.    echo $obj->date('l dS F Y h:i:s A'$time);
  15.    echo '<br /><br />';
  16.  
  17.    $obj->setMode(3);
  18.    echo $obj->date('l dS F Y h:i:s A'$time);
  19.    echo '<br /><br />';
  20.  
  21.    $obj->setMode(4);
  22.    echo $obj->date('l dS F Y h:i:s A'$time);
Popular
Recent
Links
Ads!
footer line!

No Software Patents! General Public License

Home | Twitter | Blog | Contact

Copyright © 2006 - 2016 Khaled Al-Sham'aa