-2

I have a problem on formatting the year month and date hours minutes and AM or pm how can I format this?

yyyy, mm, dd, hh: mm pm

2014-02-03 13:54:49 but I cant get the AM and PM

Wayne
  • 59,728
  • 15
  • 131
  • 126
  • show the code you have done for this..is it a timestamp date or unix timestamp – Jenz Feb 03 '14 at 05:06
  • Manuals are excellent sources of information if you bother to read them. http://PHP.net/date – vascowhite Feb 03 '14 at 05:07
  • You may want to check this thread --> http://stackoverflow.com/questions/3404699/how-to-get-am-pm-from-a-datetime-in-php =) – Knx Feb 03 '14 at 05:08

2 Answers2

2

Try:

<?php 
echo date('Y, M, d, H:i a');
?>

Lot more info here: http://php.net/date

Tigger
  • 8,980
  • 5
  • 36
  • 40
0

Try this

echo date('Y-m-d, H:i A');

Md Hasibur Rahaman
  • 1,041
  • 3
  • 11
  • 34