There is a fine distinction between g, G, h, and H. All of them are for the hour of the day, but in four different formats.
g = 12-hour format, no leading zeros
G = 24-hour format, no leading zeros
h = 12-hour format, with leading zeros
H = 24-hour format, with leading zeros
<?php
date("g:i", mktime(0,0,0,3,13,2024)) date("G:i", mktime(8,0,0,3,13,2024)) date("h:i", mktime(8,0,0,3,13,2024)) date("H:i", mktime(0,0,0,3,13,2024)) ?>
Essentially, capital letter is 24-hour format, lower case is 12-hour format. 'h' has leading zeros, 'g' does not.