fast thing I need to know how to leave the date in this format 27-Feb-17 at 21:52 my code is this <?php echo date('d/m/Y H:i', $news['published']); ?>
fast thing I need to know how to leave the date in this format 27-Feb-17 at 21:52 my code is this <?php echo date('d/m/Y H:i', $news['published']); ?>
The documentation has exactly what you want , which is M
(for the month to be in the format of Jan
to Dec
) and y
(for year be in two-number format, where 2017
is 17
).
So, just change to the format for:
echo date('d-M-y \a\s H:i', $news['published']);
d
is the day with 0
on the left ( 01
, 10
, 30
). M
is the month in short text ( Jan
, Feb
, Dec
). y
is the year with only two digits ( 00
, 01
17
). H
is the time in the 24-hour format with zero left ( 00
, 01
, 23
). i
is the minutes with zero left ( 00
, 01
, 59
).
-
and :
are just normal texts. \a\s
is to escape the text as
, if it does not use the \
the a
would be "changed" by am
and pm
and s
would be "changed" "by the seconds.