"PHP" / Говнокод #13179 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
function unix_timestamp_to_human ($timestamp = "", $format = 'D d M Y - H:i:s')
{
    if (empty($timestamp) || ! is_numeric($timestamp)) $timestamp = time();
    return ($timestamp) ? date($format, $timestamp) : date($format, $timestamp);
}

$unix_time = "1251208071";

echo unix_timestamp_to_human($unix_time); //Return: Tue 25 Aug 2009 - 14:47:51

Я всё правильно понял, код воняет?

Запостил: denis90 denis90, (Updated )

Комментарии (3) RSS

  • Комбинация пыха с датой выдаёт такой штын, что даже читать не хочется.
    Ответить
  • ($timestamp) ? date($format, $timestamp) : date($format, $timestamp);

    Але, часы есть? А если найду?
    Ответить

Добавить комментарий

Из-за тебя ушел bormand, guest!

    А не использовать ли нам bbcode?


    8