Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created May 7, 2010 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cellane/393408 to your computer and use it in GitHub Desktop.
Save Cellane/393408 to your computer and use it in GitHub Desktop.
hour = ((calendar.get (Calendar.AM_PM) == 0) ?
// Forenoon
(calendar.get (Calendar.HOUR) < 10) ?
"0" + Integer.toString (calendar.get (Calendar.HOUR)) :
Integer.toString (calendar.get (Calendar.HOUR)) :
// Afternoon
Integer.toString (calendar.get (Calendar.HOUR) + 12));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment