• Home
  • Random
  • Log in
  • Settings
  • About Safer nicotine wiki
  • Disclaimers
Safer nicotine wiki

Template:AMPM

  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]

Returns AM or PM for the hour (between 0 and 24) in parameter:

  • 00 (midnight at start of day) is normally 12 AM for the whole morning hour between 00:00 and 00:59.
  • 01..11 (end of night and morning) is unambiguously 01..11 AM.
  • 12 (noon) is normally 12 PM for the whole afternoon hour between 12:00 and 12:59.
  • 13..23 (afternoon and start of night) is unambiguously 01..11 PM.
  • 24 (midnight at end of day) is normally 12 AM (but the date must be adjusted when using the 12-hour format).
Syntax:
{{AMPM|hour24}}
Examples for AM hours:
  • "{{AMPM|24}}" returns "AM"
  • "{{AMPM|0}}" returns "AM"
  • "{{AMPM|00}}" returns "AM"
  • "{{AMPM|1}}" returns "AM"
  • "{{AMPM|01}}" returns "AM"
  • "{{AMPM|2}}" returns "AM"
  • "{{AMPM|01}}" returns "AM"
  • "{{AMPM|9}}" returns "AM"
  • "{{AMPM|09}}" returns "AM"
  • "{{AMPM|10}}" returns "AM"
  • "{{AMPM|11}}" returns "AM"
Examples for PM hours:
  • "{{AMPM|12}}" returns "PM"
  • "{{AMPM|13}}" returns "PM"
  • "{{AMPM|14}}" returns "PM"
  • "{{AMPM|15}}" returns "PM"
  • "{{AMPM|21}}" returns "PM"
  • "{{AMPM|22}}" returns "PM"
  • "{{AMPM|23}}" returns "PM"
See also:
  • Template:HOUR12
  • Template:HOUR
The above documentation is transcluded from Template:AMPM/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://safernicotine.wiki/mediawiki/index.php?title=Template:AMPM&oldid=7280"
Last edited on 15 May 2025, at 03:32
Cookies help us deliver our services. By using our services, you agree to our use of cookies.
More information

Languages

      This page is not available in other languages.

      Safer nicotine wiki
      • This page was last modified on 15 May 2025, at 03:32. Warning: Page may not contain recent updates.
      • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
      • Privacy policy
      • About Safer nicotine wiki
      • Disclaimers
      • Terms of Use
      • Desktop
      • Data access
      • Developers
      • Statistics
      • Cookie statement