php date change to 12 hour format and add gmt +3 -


i using date as:

 $date = date('m-d-y h:i:s'); 

this inserts 24 hour , want 12 hour format , add gmt +3, how can that?

if want gmt +3 timezone, apply this:

date_default_timezone_set('etc/gmt+3'); 

although don't recommend because php will not longer support timezone. might use one of supported ones. , date being in 12-hour format use way:

$date = date('m-d-y h:i:s'); 

lowercase h format character for

12-hour format of hour leading zeros


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -