I want to display date and time format something like this \"May 23 at 12:30pm\"
.
I saw in PHP manual and found:
// Prints something like: Monda
You need to escape the t
too:
echo date('M j \a\t h:i a');
You need to try this in php:
$t = now(); //This will give you current time
echo date_format($t,"dS M,y \a\\t h:i a"); //14th May,19 at 05:39am
you need to escape the a
and t
as both have special meaning when used as formatting options in date()
echo date('M j \a\t h:i a');
See it in action
Try
<?php
echo date('M j \a\t h:i a');
?>
OR
<?php
echo date('M j'). "at". date(' h:i a');
?>
Another option could be:
echo date('M j')." at ".date('h:i a');