Latest news
Home » PHP » extract date from datetime in php

extract date from datetime in php

PHP is a object oriented programming language for website building. PHP has number of in-built of functions to do different tasks .one important function is date.We can use date php function in different ways. Sometimes date from the back-end as timestamps. It means contains both date and time. some situations only need date part so use the following code.

$timewithdate = strtotime($ST_datetime);
$st_date = date(‘m/d/Y’, $timewithdate);
$st_time = date(‘H:i’, $timewithdate);


Leave a Reply


Check Also

How to print Codeigniter upload error

if you want to display errors on upload functionality in codeigniter. Use the following function ...