Booking puzzle....

S

Shankara Narayanan

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

HTH
Shankar
 
S

Shankara Narayanan

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
 
K

Kevin Spencer

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 said:
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.
 
B

bredal Jensen

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 said:
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.
 
B

bredal Jensen

Well the problem with this approach is that

"BookDate.Day" 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
 
K

Kevin Spencer

Just wanted to make sure that you had thought about that question. Nobody
had mentioned that issue in their replies, and the answer as to how to write
your query depends upon the answer to that question.

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

Jensen bredal

nothing wrong with my system clock. just playing with it
to test my algorithm. i'm doing testing testing on localhost
Fix your System Clock!
 
O

One Handed Man \( OHM - Terry Burns \)

With respect . .

When you do what you did, your post remains at the top ( annoyingly to most
people ) until the date has passed.
 
B

bredal Jensen

Sorry , fixed


One Handed Man ( OHM - Terry Burns ) said:
With respect . .

When you do what you did, your post remains at the top ( annoyingly to most
people ) until the date has passed.
 
R

Richard

fix your internal clock. It's irritating to see ppl like you abuse the
newsgroups like this.

The date now is 18-6 and not 30-6
 
K

Kevin Spencer

If you had read the complete thread, you would know that someone else had
already remarked on this, and bredal has already fixed it. According to
bredal, it was an accident. Let's give the guy a break!

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

darrel

11 AM on the client, on the server, GMT, or what?

You'll definitely want to look into this. It looks like your own system
clock is messed up (you are somehow posting questions from the future...)

-Darrel
 
K

Kevin Spencer

You'll definitely want to look into this. It looks like your own system
clock is messed up (you are somehow posting questions from the future...)

No, he was posting these questions in the past - last week to be exact. And
this issue has been resolved.

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

Cliff Harris

What he meant was the the poses from bredal are dated 6/30/2004... which is
actually kind of annoying as it always stays at the top of the article
list...
let's just all give him the bennefit of the doubt that it wasn't on
purpose..

-Cliff
 
K

Kevin Spencer

What I meant was, this issue was resolved last week.

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

Annick Van Hoof

bredal Jensen said:
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.

Also bear in mind that you might be hosting your site on a server in a
different timezone (which I do for example).

Wim
 
B

bredal Jensen

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
 
B

bredal Jensen

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.
 
B

bredal Jensen

Well i think i have found something that works:
if (DateTime.Now.AddHours(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 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top