Skip to content

Instantly share code, notes, and snippets.

@akost
Created March 9, 2017 18:42
Show Gist options
  • Save akost/31914611aa05da7ea6f8555f301c35da to your computer and use it in GitHub Desktop.
Save akost/31914611aa05da7ea6f8555f301c35da to your computer and use it in GitHub Desktop.
Ugly 12-hours formatting
<?php echo ($i <= 12) ? $i : (($i <= 24) ? ($i - 12) : ($i - 24)) ?><?php echo $i < 12 ? 'am' : ($i > 23) ? 'am' : 'pm' ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment