Last active
December 10, 2015 13:38
Revisions
-
bsalim renamed this gist
Jan 3, 2013 . 1 changed file with 8 additions and 0 deletions.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 @@ -1,4 +1,12 @@ <?php /** * Format date using PHP DateTime Object **/ function format_date_from_mysql($date,$newformatted='M d, Y') { return DateTime::createFromFormat("Y-m-d H:i:s", $date)->format($newformatted); } /** * Take mysql date format and display it nicely like a calendar format **/ -
bsalim created this gist
Jan 3, 2013 .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,29 @@ <?php /** * Take mysql date format and display it nicely like a calendar format **/ function nice_display_date($date,$time=false) { if($time) { $string = '<div style="text-align:center">'; $string .= '<span style="font-size:16px;font-weight:700;color:#999">'.format_date_from_mysql($date,'g:i A').'</span>'; $string .= '</div>'; return $string; } $string = '<div style="text-align:center">'; $string .= '<span style="font-size:16px;font-weight:700;color:#999">'. format_date_from_mysql($date,'M').'</span><br />'; $string .= '<span style="font-size:26px;font-weight:700;color:#f90">'. format_date_from_mysql($date,'d').'</span><br />'; $string .= '<span style="font-size:14px;font-weight:700;">'. format_date_from_mysql($date,'Y').'</span>'; $string .= '</div>'; return $string; }