2
quick thing I need to know how I 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']); ?>
2
quick thing I need to know how I 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']); ?>
3
To documentation has exactly what you want, which is the M
(for the month to be in the format of Jan
until Dec
) and the y
(for the year to be in the format of two numbers, where 2017
is 17
).
So just change to the format to:
echo date('d-M-y \a\s H:i', $news['published']);
d
is the day with 0
to 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 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 you do not use the \
the a
would be "exchanged" for am
and pm
and the s
would be "exchanged" for seconds.Browser other questions tagged php mysql
You are not signed in. Login or sign up in order to post.
It worked perfectly, thanks for the help.
– Carlos Gomes