By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

How to handle date and time in PHP..??

P: 1
I am facing a problem in date and time...I have a drop down list where user selects date for their appointments..I have tried some codes which does not take backdate in the database...but i need the codes to maintain the time also...suppose a user appointed 10:30-11:30 am..then other user cannot take appointment in this time...

I coded something like this for backdate...

$day=$_POST['day'];
$month=$_POST['month'];
$year=$_POST['year'];


$s_date = $year.$month.$day;
$submit_date=intval($s_date);

$booking_date = date('Y-m-d');

$b_year = date('Y', strtotime($booking_date));
$b_month = date('m', strtotime($booking_date));
$b_day = date('d', strtotime($booking_date));

$c_date = $b_year.$b_month.$b_day;
$today=intval($c_date);

and able to compare the dates.......

Plz someone help to compare the times also so that a user cannot take appointment which already taken by anothe user in a specific day...
Dec 6 '11 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,059
Try mktime function............
Dec 7 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.