Jump to content

Convert time(); to date();


HCProfessionals

Recommended Posts

here's an example

 

<?php
$timestamp ="1128831859";
$datetime = date("Y-m-d H:i:s", $timestamp);
echo $datetime; 
?>

 

I guess can make it a function too

<?php
function convertDateTime($timestamp){
$datetime = date("Y-m-d H:i:s", $timestamp);
return $datetime;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.