473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
1 1379
johny10151981
1,059 1GB
Try mktime function............
Dec 7 '11 #2

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

Similar topics

5
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an...
5
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I...
2
by: John Smith | last post by:
Hello all: I am having some difficulty trying to bind some Date Time Picker controls to a database that may have Null values in some of these fields. I continue to get the following error: ...
2
by: Need Helps | last post by:
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the graphical interface, and then used the...
3
by: RSB | last post by:
Hi Every one , IS there any Date Time Control with .Net. All i want to read is the Date and Time in a Single Field like 12/31/2004 09:23:23AM. if there is any then any examples for it. and if not...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
3
by: John | last post by:
Hi How can I check if the value stored in a datetime variable is over an hour earlier than current date time? Thanks Regards
6
by: trytobreak | last post by:
Hi All, I am a network administrator in a fairly large software company and I would like to write myself a small utility, which would connect (one by one) to all machines on the network and get...
7
by: wanwan | last post by:
Hi, I'm looking for a better way to do a date/time elapsed event rather than a timer elapsed event. Currently, I wrote my program to use a timer elapsed event set to 1 second, and it checks...
4
by: Nathan Sokalski | last post by:
When determining whether a String can be converted to a DateTime, you can use the IsDate() method. However, I would also like to know whether the string is a date, a time, or both a date and a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.