yewang/webDiplomacy — comment on commit fb1686709a478870c334c13ce2f494a29d199601
File:  line 0
By kestasjk:

I think the 22 hour length was because it's doing time differences, so rather than saying "that happened 22 hours ago" you're more likely to say "that happened yesterday" or (if it's Wednesday) "that happened on Tuesday", so there's a bit of an arbitrary threshold there, which is debatable.

The logic here is:
If it's more than or equal to 12 then it's PM, so subtract 12.
If the result is 0, make it 12 (so it's 12:15 rather than 00:15).
If the result is less than 10 add a 0 (so it's 01:00 rather than 1:00).

The last one can be debated, but from looking at the code you submitted it looks like if it was 00:15am then the code would come out as 00:15am