View Full Version : Creating a timestamp using informations from a post

09-08-2009, 04:32 PM
Hi all, I was wondering if anyone could help me creating a php function which will create a timestamp using some posting values here is my code :)

seconds will always be 0

i need something like

function createTimestamp($month, $day, $year, $hour, $minute)
// do the cool threatment :)

return $coolTimeStamp;

the day will be of type "j" which means from 1-31 not including 0's.
month will be of type "n" which means from 1-12 not including 0's.
year is type "Y" which means 0000 format.
hours of type "H" not using AM PM Ex: 19h30
minutes of type "m" using 0's example 09 minutes :)

thanks in advance.


if( isset($_SESSION["dcmsa"]) )

$id = $_POST["id"];
$title = $_POST["title"];
$desc = $_POST["desc"];
$month = $_POST["month"];
$day = $_POST["day"];
$year = $_POST["year"];
$hour = $_POST["hour"];
$minutes = $_POST["minutes"];

if( $id == 0 )




09-08-2009, 04:36 PM
You want to use MKTIME

Have a look at the mktime function on php.net!