ShivaGupta Posted August 27, 2013 Share Posted August 27, 2013 i use this to get current hour info. $now = Date("h"); but here is a prov .i get result as am pm eg 08 pm.but i want as 24hours eg 20. can u help me out plz. Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/ Share on other sites More sharing options...
Barrikor Posted August 27, 2013 Share Posted August 27, 2013 Just swap it to a capital H and you get the 24 hour time =) Edit: or 'G' if you want to get rid of the leading zeros. Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/#findComment-1447003 Share on other sites More sharing options...
Psycho Posted August 27, 2013 Share Posted August 27, 2013 Shiva, Not to be rude, but did you even look at the manual for the date() function? It gives a whole table of the different 'format' characters and an explanation of what the return value will be for each. Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/#findComment-1447005 Share on other sites More sharing options...
ShivaGupta Posted August 27, 2013 Author Share Posted August 27, 2013 Just swap it to a capital H and you get the 24 hour time =) Edit: or 'G' if you want to get rid of the leading zero Thank You Sir. Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/#findComment-1447006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.