You are here

public static function DatexFormatter::format in Datex 7

Similar to php date_format.

Parameters

mixed $date: Date to format. For a list of accepted dates see ObjectFromDate.

DateTimeZone $tz: DateTimeZone object or name (string) of timezone area.

bool $use_intl: Wheter to use PHP-Intl or not, recomended: TRUE.

array $intl_args: Arguments passed to PHP-Intl formatter.

Return value

string formatted date.

9 calls to DatexFormatter::format()
DatexObject::format in datex_api/datex_api_classes.inc
Similar to DateTime::format().
DatexObject::monthLastDay in datex_api/datex_api_classes.inc
Returns an object containing last day of Jalali month.
DatexObjectUtils::date in datex_api/datex_api_classes.inc
See php date().
datex_datex_format_alter in ./datex.module
Implements hook_datex_format_alter().
datex_date_date_formatter_dates_alter in datex_date/datex_date.module
Implemetns hook_date_formatter_dates_alter().

... See full list

File

datex_api/datex_api_classes.inc, line 49
API and helper functions used by other datex modules.

Class

DatexFormatter
Date tools for Jalali Dates.

Code

public static function format($date, $format, $tz = NULL, $use_intl = DATEX_USE_INTL, $intl_args = array()) {
  if (self::hasINTL() && $use_intl) {
    return self::formatINTL($date, $format, $tz, $intl_args);
  }
  else {
    return self::formatPHP($date, $format, $tz);
  }
}