How would go about adding AM/PM to the ending of the following code snippet? So for it outputs like this: 04/21/2012 07:59.
<?=mdate('%m/%d/%Y %H:%i', strtotime($row->entryCreationDateTime))?>
How would go about adding AM/PM to the ending of the following code snippet? So for it outputs like this: 04/21/2012 07:59.
<?=mdate('%m/%d/%Y %H:%i', strtotime($row->entryCreationDateTime))?>
Unless you're trying to use this in a query, you could use date
. From the documentation, AM/PM are given by "A":
<?php echo date('m/d/Y H:i A', strtotime($row->entryCreationDateTime)); ?>
As an aside, it's generally a good idea to avoid short tags in your code.
I believe it's
# 'AM' or 'PM' - upper case 'A'
<?=mdate('%m/%d/%Y %H:%i A', strtotime($row->entryCreationDateTime))?>
or
# 'am' or 'pm' - lowercase 'a'
<?=mdate('%m/%d/%Y %H:%i a', strtotime($row->entryCreationDateTime))?>