This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 2 years ago.
I have a time value in the following data format:
"2020-08-05T11:45:10.3159677Z"
How do I convert it to something human readable, like as follows, using PHP?
Wednesday, August 5, 2020, 11:45 AM
Try this:
echo date("H:i A, F jS, Y", strtotime("2020-08-05T11:45:10.3159677Z"));
Related
This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 3 years ago.
How can I get the full name of the day of the week in PHP like Monday or Friday?
try:
echo date('D, d M Y h:i:s');
https://www.php.net/manual/en/function.date.php
This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 5 years ago.
I am fetching time and date from MYSQLi using php. For time I am getting default 24 hr format and for date I am recieving format of y/m/d.
I want to get time in 12 hr format.
I want to get date in d/m/y format.
How to do it in php ?
In pure simple php, you can write as follow
Date
echo date('d/m/Y', strtotime($your_date));
Time
echo date('H:i', $your_time);
For the 12 hours, use
echo date('g:i A', $your_time);
This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 6 years ago.
I am doing php parsing and getting date like Thu 1 Dec and I want to store it in database and my date column in database is of DATE type, so when I store this in database, it inserts 0000-00-00 because of improper format. How can I convert it into proper format?
To format the date properly, use something like this
$Date = Date('c', strtotime($Date))
The date has to be something strtotime can understand, but strtotime can understand a lot.
This question already has answers here:
How to create human readable time stamp?
(6 answers)
Closed 6 years ago.
i'm currently looking at something and it says this.
"last_updated":1471323637
how can i convert that number into a time that I can actually read because at the moment i have no idea what time/date that is.
thank you.
Use FROM_UNIXTIME if you want to convert it to human readable time in MySQL
SELECT FROM_UNIXTIME(1471323637);
And you will get an output like below:
2016-08-16 11:00:37
Try this
echo date('H:i:s d/m/y' ,1471323637);
Output
10:30:37 16/08/16
for more info about date please read http://php.net/manual/en/function.date.php
You can also try this
echo date("g:i a, j M Y" ,1471323637);
Output
10:30 am, 16 Aug 2016
This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 7 years ago.
I want to echo the current month in full text. eg : june;
echo date('M');
// result jun.
but i want to display full month. how can i do that.
You can use date with F (have a look at the docs).
So date("F") will output June.