ShivaGupta Posted August 27, 2013 Share Posted August 27, 2013 (edited) 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. Edited August 27, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/ Share on other sites More sharing options...
Solution Barrikor Posted August 27, 2013 Solution Share Posted August 27, 2013 (edited) 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. Edited August 27, 2013 by Barrikor Quote 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 (edited) 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. Edited August 27, 2013 by Psycho Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/281608-need-help-with-time/#findComment-1447006 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.