Get AM or PM Based on a Given Hour

The Date::ampm() method will return either AM or PM based on the given hour. Works for 24 hour clock only.

Usage

  echo Date::ampm(8);
  AM
  echo Date::ampm(11);
  AM
  echo Date::ampm(12);
  PM
  echo Date::ampm(18);
  PM
get_am_or_pm_based_on_a_given_hour.txt · Last modified: 2009/12/10 16:29 by kerkness