Test Ar-PHP Functionality Online

header line!
Test PHP Function













Ar-PHP Manual

static method strtotime [line 128]

static Integer strtotime( string $text, integer $now)

This method will parse about any Arabic textual datetime description into a Unix timestamp



Tags:

return:  Returns a timestamp on success, FALSE otherwise
author:  Khaled Al-Sham'aa <khaled@ar-php.org>
access:  public


Parameters:

string   $text   The string to parse, according to the GNU » Date Input Formats syntax (in Arabic).
integer   $now   The timestamp used to calculate the returned value.

Example
  1.      date_default_timezone_set('UTC');
  2.      $time = time();
  3.  
  4.      echo date('l dS F Y'$time);
  5.      echo '<br /><br />';
  6.  
  7.      include('./I18N/Arabic.php');
  8.      $obj new I18N_Arabic('StrToTime');
  9.  
  10.      $int  $obj->strtotime($str$time);
  11.      $date = date('l dS F Y'$int);
  12.      echo "<b><font color=#FFFF00>Arabic String:</font></b> $str<br />";
  13.      echo "<b><font color=#FFFF00>Unix Timestamp:</font></b> $int<br />";
  14.      echo "<b><font color=#FFFF00>Formated Date:</font></b> $date<br />";
Popular
Recent
Links
Ads!
footer line!

No Software Patents! General Public License

Home | Twitter | Blog | Contact

Copyright © 2006 - 2016 Khaled Al-Sham'aa