Formatting Characters For The Date() Function For Hour

 
Character        Description
h                Hour in 12-hour format, with leading zero (two digits).
g                Hour in 12-hour format (no leading zero).
H                Hour in 24-hour format, with leading zero (two digits).
G                Hour in 24-hour format (no leading zero).
a                am/pm (lowercase).
A                AM/PM (uppercase).
O(uppercase o)   String representation of the difference in hours between local time and GMT/UTC (for w3mentor, +1000, �0500).

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.