473,785 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Booking puzzle....

Hello gurus,
I'm building a small booking system and i have come accross quiet a tedious
pitfall.

"I need to make sure that people do not book for tomorrow when todays time
is greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are making
this booking
and only if it is the day after today.
Many thanks in advance

J.B

Nov 18 '05 #1
20 1690
if BookingDate > DateTime.Today. Date &&
DateTime.Now.To String("HH:mm:s s") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:
Hello gurus,
I'm building a small booking system and i have come accross quiet a tedious
pitfall.

"I need to make sure that people do not book for tomorrow when todays time
is greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are making
this booking
and only if it is the day after today.
Many thanks in advance

J.B



--
With best Regards
Shankara Narayanan
Nov 18 '05 #2
well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in the
futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
if BookingDate > DateTime.Today. Date &&
DateTime.Now.To String("HH:mm:s s") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:
Hello gurus,
I'm building a small booking system and i have come accross quiet a tediouspitfall.

"I need to make sure that people do not book for tomorrow when todays timeis greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are makingthis booking
and only if it is the day after today.
Many thanks in advance

J.B



--
With best Regards
Shankara Narayanan

Nov 18 '05 #3
Well i think i have found something that works:
if (DateTime.Now.A ddHours(10).Day ==bookDate.Day) { do not book}
.. I have tested it works but
it requires some mathematics to prove that it will not break in 20 or 30
years
I Think.


"bredal Jensen" <br******@jense n.dk> wrote in message
news:uO******** ******@TK2MSFTN GP09.phx.gbl...
well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in the futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
if BookingDate > DateTime.Today. Date &&
DateTime.Now.To String("HH:mm:s s") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:
Hello gurus,
I'm building a small booking system and i have come accross quiet a tediouspitfall.

"I need to make sure that people do not book for tomorrow when todays timeis greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are makingthis booking
and only if it is the day after today.
Many thanks in advance

J.B



--
With best Regards
Shankara Narayanan


Nov 18 '05 #4
if (DateTime.Now.A ddHours(13).Day ==bookDate.Day) { do not book}


"bredal Jensen" <br******@jense n.dk> wrote in message
news:eP******** *****@TK2MSFTNG P10.phx.gbl...
Hello gurus,
I'm building a small booking system and i have come accross quiet a tedious pitfall.

"I need to make sure that people do not book for tomorrow when todays time
is greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are making
this booking
and only if it is the day after today.
Many thanks in advance

J.B

Nov 18 '05 #5
Hi -

Instead of adding hours - it would be much easier to add days

If( BookDate.Day == DateTime.Today. AddDays(1) )
return;

Then you can have your calculation of time.

With best Regards
Shankara Narayanan

bredal Jensen wrote:
Well i think i have found something that works:
if (DateTime.Now.A ddHours(10).Day ==bookDate.Day) { do not book}
.. I have tested it works but
it requires some mathematics to prove that it will not break in 20 or 30
years
I Think.


"bredal Jensen" <br******@jense n.dk> wrote in message
news:uO******* *******@TK2MSFT NGP09.phx.gbl.. .

well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in

the

futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0****** ********@TK2MSF TNGP10.phx.gbl. ..

if BookingDate > DateTime.Today. Date &&
DateTime.Now .ToString("HH:m m:ss") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:

Hello gurus,
I'm building a small booking system and i have come accross quiet a

tedious

pitfall.

"I need to make sure that people do not book for tomorrow when todays

time

is greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are

making

this booking
and only if it is the day after today.
Many thanks in advance

J.B



--
With best Regards
Shankara Narayanan



Nov 18 '05 #6
11 AM on the client, on the server, GMT, or what?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"bredal Jensen" <br******@jense n.dk> wrote in message
news:uO******** ******@TK2MSFTN GP09.phx.gbl...
well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in the futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
if BookingDate > DateTime.Today. Date &&
DateTime.Now.To String("HH:mm:s s") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:
Hello gurus,
I'm building a small booking system and i have come accross quiet a tediouspitfall.

"I need to make sure that people do not book for tomorrow when todays timeis greater or equal to 11."
Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are makingthis booking
and only if it is the day after today.
Many thanks in advance

J.B



--
With best Regards
Shankara Narayanan


Nov 18 '05 #7
well that was a good question...
i did not think global while posting this on a global
news group.;)
But i assumm the booking person is on the same time
zone as where the event is taking place.

But the time would have to be on the server . since different client
probably
have different times.


"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:Oa******** ******@TK2MSFTN GP09.phx.gbl...
11 AM on the client, on the server, GMT, or what?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"bredal Jensen" <br******@jense n.dk> wrote in message
news:uO******** ******@TK2MSFTN GP09.phx.gbl...
well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in

the
futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
if BookingDate > DateTime.Today. Date &&
DateTime.Now.To String("HH:mm:s s") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:

>Hello gurus,
>
>
>I'm building a small booking system and i have come accross quiet a

tedious
>pitfall.
>
>"I need to make sure that people do not book for tomorrow when todays

time
>is greater or equal to 11."
>
>
>Well some of you probably allready know the answer but this is not so
>obvious for me.
>
>Can anyone solve this puzzle for me?
>
>The booking hour is of no importance. Only the hour at which we are

making
>this booking
>and only if it is the day after today.
>
>
>Many thanks in advance
>
>J.B
>
>
>
>
>

--
With best Regards
Shankara Narayanan



Nov 18 '05 #8
Well the problem with this approach is that

"BookDate.D ay" may match a " DateTime.Today. AddDays(1) " very far out in the
future
and then prevent booking mistakenly.

I have experienced that the day property of the DateTime object is beetwenn
(1 and 31).
I hope i'am right.


is that
"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
Hi -

Instead of adding hours - it would be much easier to add days

If( BookDate.Day == DateTime.Today. AddDays(1) )
return;

Then you can have your calculation of time.

With best Regards
Shankara Narayanan

bredal Jensen wrote:
Well i think i have found something that works:
if (DateTime.Now.A ddHours(10).Day ==bookDate.Day) { do not book}
.. I have tested it works but
it requires some mathematics to prove that it will not break in 20 or 30
years
I Think.


"bredal Jensen" <br******@jense n.dk> wrote in message
news:uO******* *******@TK2MSFT NGP09.phx.gbl.. .

well it does not help me because it should be
possible to book for the day after tommorrow and all the other days in

the

futue.
Just not tomorrow.

And by the way , i meant 11 AM, but i guess it is probably not so
important.


"Shankara Narayanan" <js*****@yahoo. co.in> wrote in message
news:u0****** ********@TK2MSF TNGP10.phx.gbl. ..
if BookingDate > DateTime.Today. Date &&
DateTime.Now .ToString("HH:m m:ss") > "23:00"
{
return;
}

HTH
Shankar
bredal Jensen wrote:

>Hello gurus,
>
>
>I'm building a small booking system and i have come accross quiet a
>
>
tedious
>pitfall.
>
>"I need to make sure that people do not book for tomorrow when todays
>
>
time
>is greater or equal to 11."
>
>
>Well some of you probably allready know the answer but this is not so
>obvious for me.
>
>Can anyone solve this puzzle for me?
>
>The booking hour is of no importance. Only the hour at which we are
>
>
making
>this booking
>and only if it is the day after today.
>
>
>Many thanks in advance
>
>J.B
>
>
>
>
>
>
>
--
With best Regards
Shankara Narayanan


Nov 18 '05 #9
Fix your System Clock!

"bredal Jensen" <br******@jense n.dk> wrote in message news:eP******** *****@TK2MSFTNG P10.phx.gbl...
Hello gurus,


I'm building a small booking system and i have come accross quiet a tedious
pitfall.

"I need to make sure that people do not book for tomorrow when todays time
is greater or equal to 11."


Well some of you probably allready know the answer but this is not so
obvious for me.

Can anyone solve this puzzle for me?

The booking hour is of no importance. Only the hour at which we are making
this booking
and only if it is the day after today.


Many thanks in advance

J.B


Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
18693
by: Dave Robinson | last post by:
I was wondering if anyone could help me with a problem I'm having. I've been using Dreamweaver to create a hotel booking system for a friend of mine, using MySQL (version 4.0.21) and PHP 5. The bit I'm struggling with is checking the Room Availability based on dates that are typed into a textfield and then returning a list of the available rooms on the next page. The three tables involved in this function are: CREATE TABLE `room` (
2
8240
by: Andy | last post by:
Hi folks I teach. At school, four IT rooms are booked using a paper based outline timetable. Completing it is easy but basic and impossible to ensure completion of all fields (name, year group, subject and software) and analysis of bookings is a nightmare. I just fancied pottering with Access, which I am pretty familiar with, to see if I could create a means of booking a room using a database. Locking a booking would then be a...
0
1571
by: thegame21 | last post by:
Hi, I am currently creating a cinema system using access where a booking can be made for a event. Each event when it is shown is categoriesd as a performance. A booking must be made for each performamce. I have a constructed a query between the booking, event and peformance tables and created a subform on the booking form. The event table is linked to the performance table which in turn is linked to the booking table. I keep on getting the...
1
13108
by: xavier vazquez | last post by:
I have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of the other....how i can fix this the program look like this import java.util.ArrayList; import java.util.Random;
0
2027
by: xavier vazquez | last post by:
have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of the other....how i can fix this this run the random words for the program import javax.swing.JOptionPane; import java.util.ArrayList; import java.util.Random; public class CrossWordPuzzleTester {
1
3217
by: simba | last post by:
Hello, I am currently doing a project which requires me to develop an online booking system for hotels and integrate both bed and room booking. I have the room booking working but I cant seem to get the bed booking working. I have dorm rooms with 8 beds in them and I would like to have a query(or something) which allows me to make the dorm rooms bed booked instead of room booked. Anyone any ideas on how to make this happen, anything would be...
25
2866
by: NDayave | last post by:
How do, I have a access 2000 booking database with Personal Details, Outing Details and the Bookings in three tables: tblBookings -- -Autonumber, -Number, -Number, -Currency, -Yes/No, -Yes/No tblPersonaldetails -- -Autonumber, etc tblOutingDetails -- -Autonumber, etc
3
3209
by: oncue01 | last post by:
Word Puzzle Task You are going to search M words in an N × N puzzle. The words may have been placed in one of the four directions as from (i) left to right (E), (ii) right to left (W), (iii) up to bottom (S), or (iv) bottom to up (N). The program will print the starting place and the direction of each word. Limitations The number of words to be searched can be at most 100, the size of the puzzle N can be minimum 5 maximum 20....
4
19996
by: honey777 | last post by:
Problem: 15 Puzzle This is a common puzzle with a 4x4 playing space with 15 tiles, numbered 1 through 15. One "spot" is always left blank. Here is an example of the puzzle: The goal is to get the tiles in order, 1 through 15, from left to right, top to bottom, by just sliding tiles into the empty square. In this configuration, the goal would be to get the 14 and 15 to switch places, without affecting any of the other squares. Your...
0
10336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8978
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.