473,911 Members | 5,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time Function

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.
Aug 15 '06 #1
6 1333
Badass wrote on 15 aug 2006 in microsoft.publi c.inetserver.as p.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)
Aug 15 '06 #2
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"
Aug 15 '06 #3
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.
Aug 15 '06 #4
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 :o)

G.
Aug 15 '06 #5
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" <ba****@spamspa m.comwrote in message
news:qO******** *********@text. news.blueyonder .co.uk...
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.


Aug 16 '06 #6

"Bob Lehmann" <no****@dontbot herme.zzzwrote in message
news:O3******** ******@TK2MSFTN GP04.phx.gbl...
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).
Aug 18 '06 #7

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

Similar topics

2
5238
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
6
12967
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone here put me straight on the following: I had a look at the time() function came across this: "To clarify, it seems this function returns the time of the computer's clock and does not do any timezone adjustments to return GMT, so you are...
17
3141
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the absolute address of alpha to access to it. What confuses me is that when the variable is dynamically allocated, how does the compiler implement it? We know the address of the variable until run-time. During the compilation, how can we access to the...
17
2220
by: Razzel | last post by:
I created this as a test: #include <time.h> main(){ printf(X1: %s\n", putim()); printf(X2: %s\n", putim()); } putim() { time_t t; time(&t); return(ctime(&t));
5
3122
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when i used time.sleep in while, the function in while never executed. then i found something about Timer but couldnt realize any algorithm in my mind.
3
2038
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And to be able to do comparisons on them.
6
12570
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a calendar control to allow my users to enter a date but I need them to enter a time as well. It doesn't look like the calendar control will allow times to be entered so I was thinking of having two text boxes. One text box would contain the date...
9
8313
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the following to try to determine which. import time # Determine if time.time is better than time.clock # The one with better resolution should be lower.
0
16521
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all. They are simple, easy, and brief and you should use them any time you need to incorporate any date literals or date math in your T-SQL code. create function DateOnly(@DateTime DateTime) -- Returns @DateTime...
1
2342
by: nigelesquire | last post by:
I am in need of your assistance. I have a page with multiple unixtime stamps and I need to display them in readable time and date with the user's time zone. Below is the code. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
0
10038
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11349
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...
1
11057
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,...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4776
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
4341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3360
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.