2015-04-15 javascript►hour Format hour to 12 hour clock in javascript By: Ryan Wong at Apr 15 2015 7:52 pm This snippet will help you format a 24 hour time to a 12 hour time. 1234567function fixHour(e){ var t=" AM"; if(e>=12&&e<24){ t=" PM"; } return(e+11)%12+1+t;} Hope it helps. Newer Calculate distance between two gps location using mysql Older Calculate distance between two gps location using javascript