You are here

function _classified_get_date_from_timestamp in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 classified.module \_classified_get_date_from_timestamp()

Convert a UNIX timestamp to the format used by the date widget.

Note that this is a one-way conversion: hour/minute/second information is lost in the conversion.

Parameters

int $ts: A UNIX timestamp.

Return value

array Or NULL for The Epoch ($ts == 0).

See also

_classified_timestamp_from_date()

1 call to _classified_get_date_from_timestamp()
classified_form in ./classified.module
Implements hook_form().

File

./classified.module, line 260
A pure D7 classified ads module inspired by the ed_classified module.

Code

function _classified_get_date_from_timestamp($ts) {
  $date = getdate($ts);
  $ret = $ts ? array(
    'day' => $date['mday'],
    'month' => $date['mon'],
    'year' => $date['year'],
  ) : NULL;
  return $ret;
}