Created
May 4, 2015 07:23
-
-
Save nullproduction/3c9a87c4ba71d6eda43f to your computer and use it in GitHub Desktop.
Revisions
-
nullproduction renamed this gist
May 4, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nullproduction created this gist
May 4, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php namespace App\Libs\Helper; use Jenssegers\Date\Date; class Helper { /** * Get Date */ public static function getDate($date) { $twoDaysSeconds = 60 * 60 * 24 * 2; $seconds = time() - Date::parse($date)->timestamp; if ($seconds == 0) return 'Сейчас'; return ($seconds < $twoDaysSeconds) ? Date::parse($date)->ago() : Date::parse($date)->format("j M в H:i"); } }