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

Export Database using codeigniter

Database Utility Class : CodeIgniter PHP script to download mysql db-codeigniter,Backup MySQL database with CodeIgniter ...