Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Time Function

Reply
Thread Tools

Time Function

 
 
Badass
Guest
Posts: n/a
 
      08-15-2006
Hello,

Can anyone think of a short piece of code which does he following:
-------------------------------------
if Current Time is LESS THAN 19:30 then Write: Open For Business

Else

Write: Sorry - Closed
-------------------------------------
and
-------------------------------------
if Current Time is Between 12:00 and 14:00 then Write: Away to Lunch
Else
Write: Open For Business
-------------------------------------

It's actually for a call centre app, just the above scenario is much easier
to explain. Any help appreciated!!!

Regards,

Gary.


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      08-15-2006
Badass wrote on 15 aug 2006 in microsoft.public.inetserver.asp.general:
> Can anyone think of a short piece of code which does he following:


Certainly I can, I am thinking of it now.
Should it be under serverside asp? ASP

> -------------------------------------
> if Current Time is LESS THAN 19:30 then Write: Open For Business
>
> Else
>
> Write: Sorry - Closed
> -------------------------------------
> and
> -------------------------------------
> if Current Time is Between 12:00 and 14:00 then Write: Away to Lunch
> Else
> Write: Open For Business
> -------------------------------------
>
> It's actually for a call centre app, just the above scenario is much
> easier to explain. Any help appreciated!!!


What have you done sofar yourself?

For help, we would have to no where you go wrong.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-15-2006
Badass wrote:
> Hello,
>
> Can anyone think of a short piece of code which does he following:
> -------------------------------------
> if Current Time is LESS THAN 19:30 then Write: Open For Business
>
> Else
>
> Write: Sorry - Closed
> -------------------------------------
> and
> -------------------------------------
> if Current Time is Between 12:00 and 14:00 then Write: Away to Lunch
> Else
> Write: Open For Business
> -------------------------------------
>
> It's actually for a call centre app, just the above scenario is much
> easier to explain. Any help appreciated!!!
>

This explanation is contradictory, but I think I understand what you mean.
If you wish to write code, you need to learn to clearly state your
requirements. Try it this way:

if time later than 19:30 write "Sorry - Closed"
if time between 12:00 and 14:00 then write "Away to Lunch"
otherwise, write "Open For Business"

Assuming you wish this done in vbscript, then this should do it for you:

<%
dim t
t=now() - date()
't now contains just the current time
if t > #19:30# then
Response.Write "Sorry - Closed"
Elseif t >= #12:00# and t <= #14:00# then
Response.Write "Away to Lunch"
Else
Response.Write "Open For Business"
End if
%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Badass
Guest
Posts: n/a
 
      08-15-2006
> What have you done sofar yourself?


Not tried it yet, rather than spend 3 hours trying to work it out, I thought
I would check for some help here. I always eventually manage to get things
working on my own if I get no replies, but mostly people are happy to help.

Thanks for the reply.

G.


 
Reply With Quote
 
Badass
Guest
Posts: n/a
 
      08-15-2006
> Assuming you wish this done in vbscript, then this should do it for you:
>
> <%
> dim t
> t=now() - date()
> 't now contains just the current time
> if t > #19:30# then
> Response.Write "Sorry - Closed"
> Elseif t >= #12:00# and t <= #14:00# then
> Response.Write "Away to Lunch"
> Else
> Response.Write "Open For Business"
> End if
> %>



Thanks for the reply, will give it a try )

G.


 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      08-16-2006
Dear lameass,

>> but mostly people are happy to help.

So, apparently you don't understand the difference between "helping" and
"doing it for you"?

Bob Lehmann

"Badass" <(E-Mail Removed)> wrote in message
news:qOsEg.4082$(E-Mail Removed) k...
> > What have you done sofar yourself?

>
>
> Not tried it yet, rather than spend 3 hours trying to work it out, I

thought
> I would check for some help here. I always eventually manage to get

things
> working on my own if I get no replies, but mostly people are happy to

help.
>
> Thanks for the reply.
>
> G.
>
>



 
Reply With Quote
 
Badass
Guest
Posts: n/a
 
      08-18-2006

"Bob Lehmann" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear lameass,
>
>>> but mostly people are happy to help.

> So, apparently you don't understand the difference between "helping" and
> "doing it for you"?
>
> Bob Lehmann




Well if someone were to do it for me, it would be a tremendious help!!!
Either way, its helping...

Badass (Apparently Lame).


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
Re: interpreting the fractional portion of time.clock() vs time.time()measurements Peter Hansen Python 0 02-22-2006 12:03 AM
time.clock() or time.time() peterbe@gmail.com Python 8 08-05-2005 01:51 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
delta time = time stop - time start engsol Python 2 01-26-2004 12:06 PM



Advertisments