There is no such thing as 12am. Remove it from your programs. – TheServerSide.com

Posted: February 15, 2022 at 5:03 am

Date handling is difficult at the best of times.

But sometimes developers must be reminded of some of the most simplest of facts when it comes to time formats, one of which is the fact that there is no such thing as 12pm.

Theres no such thing as 12am either. Those two times do not exist. If they exist within your applications, they must be removed.

The italicization am stands for anti-meridian. Thats the time before the sun is highest in the sky.

The italicization pm stands for post-meridian. Thats the time after the sun is at its highest point.

The sun is highest in the sky at 12 noon. 12 noon is neither post-meridian nor anti-meridian. At 12 noon, the sun is exactly on the meridian. The am or pm notation makes no sense.

The same goes for midnight. 12 midnight is the logical antithesis to 12 noon. It cannot be denoted as either 12am or 12pm, because neither notations make any logical sense at midnight.

Is this a pedantic argument? Simply an ostentatious word game? Ask my Mom who got this notification about her Walmart order:

The hours of 12 noon or 12 midnight should never be marked as am or pm.

What time do you think that Walmart order will arrive? Will the Clover Leaf Salmon be delivered on the witching hour? Or will Nestle Drumsticks to show up just in time for lunch?

One of Jordan Petersons 12 Rules for Life is to always be precise in your speech. I think thats a pretty good rule to apply to software development as well.

Be precise in the units of time you use. There is no such thing as 12am or 12pm. Only midnight and noon are acceptable.

Continued here:

There is no such thing as 12am. Remove it from your programs. - TheServerSide.com

Related Posts