Arabic
[ class tree: Arabic ] [ index: Arabic ] [ all elements ]

Class: ArDate

Source Location: /sub/ArDate.class.php

Class Overview


This PHP class is an Arabic customization for PHP date function


Author(s):

Copyright:

  • 2009 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 167]
This PHP class is an Arabic customization for PHP date function



Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2009 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL


[ Top ]


Class Variables

static $_ISLAMIC_EPOCH =  1948439.5

[line 170]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_mode =  1

[line 169]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


method date [line 234]

string date( string $format, integer $timestamp, [string $outputCharset = null], [integer $correction = 0], [object $main = null])

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-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $format   Format string (same as PHP date function)
integer   $timestamp   Unix timestamp
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
integer   $correction   To apply correction factor (+/- 1-2) to standard hijri calendar
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

method dateCorrection [line 623]

integer dateCorrection( integer $time)

Calculate Hijri calendar correction using Um-Al-Qura calendar information



Tags:

return:  Correction factor to fix Hijri calendar calculation using Um-Al-Qura calendar information
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

integer   $time   Unix timestamp

[ Top ]

method getMode [line 214]

Integer getMode( )

Getting $mode value that refer to output mode format

1) Hijri format (Islamic calendar) 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libyan way




Tags:

return:  Value of $mode properity
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


[ Top ]

method setMode [line 187]

boolean setMode( [integer $mode = 1])

Setting value for $mode scalar



Tags:

return:  TRUE if success, or FALSE if fail
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

integer   $mode   Output mode of date function where: 1) Hijri format (Islamic calendar) 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libya style 6) Algeria and Tunis style 7) Morocco style

[ Top ]

method _arabicMonths [line 431]

array _arabicMonths( integer $mode)

Add Arabic month names to the replacement array



Tags:

return:  Arabic month names in selected style
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $mode   Naming mode of months in Arabic where: 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libya style 6) Algeria and Tunis style 7) Morocco style

[ Top ]

method _en2ar [line 331]

string _en2ar( string $str)

Translate English date/time terms into Arabic langauge



Tags:

return:  Date/time string using Arabic terms
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $str   Date/time string using English terms

[ Top ]

method _gregToJd [line 598]

integer _gregToJd( integer $m, integer $d, integer $y)

Converts a Gregorian date to Julian Day Count



Tags:

return:  The julian day for the given gregorian date as an integer
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $m   The month as a number from 1 (for January) to 12 (for December)
integer   $d   The day as a number from 1 to 31
integer   $y   The year as a number between -4714 and 9999

[ Top ]

method _hjConvert [line 541]

array _hjConvert( integer $Y, integer $M, integer $D)

Convert given Gregorian date into Hijri date



Tags:

return:  Hijri date [int Year, int Month, int Day](Islamic calendar)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $Y   Year Gregorian year
integer   $M   Month Gregorian month
integer   $D   Day Gregorian day

[ Top ]

method _islamicToJd [line 583]

integer _islamicToJd( integer $year, integer $month, integer $day)

Convert given Hijri date into Julian day



Tags:

return:  Julian day
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $year   Year Hijri year
integer   $month   Month Hijri month
integer   $day   Day Hijri day

[ Top ]

method _jdToIslamic [line 562]

array _jdToIslamic( integer $jd)

Convert given Julian day into Hijri date



Tags:

return:  Hijri date [int Year, int Month, int Day](Islamic calendar)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $jd   Julian day

[ Top ]


Documentation generated on Fri, 12 Mar 2010 01:01:42 +0300 by phpDocumentor 1.4.0