473,493 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

time release ASP code

How can I made time released ASP code? I want to make section of code
viewable after a certain date. Something to this effect, but this does not
work right:
if now() >= "6/24/2005" then
Response.Write ( "here is my new html" )
else
Response.Write ( "for now just show the current information" )
end if

Jul 22 '05 #1
10 1540
"Rusted" <no*****@please.com> wrote in message
news:Vr****************@fe04.usenetserver.com...
How can I made time released ASP code? I want to make section of code
viewable after a certain date. Something to this effect, but this does
not work right:
if now() >= "6/24/2005" then
Response.Write ( "here is my new html" )
else
Response.Write ( "for now just show the current information" )
end if


Date literals should be delimited with #. Here's a reference:
http://msdn.microsoft.com/library/en...ndamentals.asp

Please consider using ISO standard date formats YYYYMMDD or YYYY-MM-DD.
Here's a related article:
http://aspfaq.com/show.asp?id=2260

Response.Write does not return a value, so there is no need for the
parentheses when making the call.
Jul 22 '05 #2
"Rusted" <no*****@please.com> wrote in message
news:Vr****************@fe04.usenetserver.com...
: How can I made time released ASP code? I want to make section of code
: viewable after a certain date. Something to this effect, but this does
not
: work right:
:
:
: if now() >= "6/24/2005" then
: Response.Write ( "here is my new html" )
: else
: Response.Write ( "for now just show the current information" )
: end if

Since this is running server-side I don't see a need to make it an ISO
standard.

This will do what you want:

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

sub lprt(str)
Response.Write str & "<br />" & vbCrLf
end sub

dim n, t
t = "6/24/2005" ' target date
n = FormatDateTime(now,vbShortDate) ' now - current date

if n >= t then
lprt "Current date " & n & " is greater than or equal to: " & t
else
lprt "Current date " & n & " is prior to " & t
end if
%>

http://kiddanger.com/lab/timerelease.asp

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #3
Roland Hall wrote on 06 mei 2005 in
microsoft.public.inetserver.asp.general:
Since this is running server-side I don't see a need to make it an ISO
standard.


What you do on your own site is for your taste.

What you advise here should be as general as possible.

The below code switched at 00:00 Central European,
while the server is in Toronto, Canada and on that time:
<%
d = #2005-04-20 18:00# ' 21/4/05 00:00 CET
if now>d then
%>
Switched,<br>you're too late!
<% else %>
Not yet,<br>friend!
<% end if %>
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #4
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
: Roland Hall wrote on 06 mei 2005 in
: microsoft.public.inetserver.asp.general:
: > Since this is running server-side I don't see a need to make it an ISO
: > standard.
:
: What you do on your own site is for your taste.
:
: What you advise here should be as general as possible.

How can that date be interpreted any other than mm/dd/yyyy? It's on the
server, and if the server is in the US, it works for everyone worldwide.
Client-side, I would agree with you. Server-side, I do not.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #5
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:OV**************@TK2MSFTNGP09.phx.gbl...
:
: Date literals should be delimited with #. Here's a reference:
:
http://msdn.microsoft.com/library/en...ndamentals.asp

I couldn't find a date literal listed except under isDate.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #6
"Rusted" <no*****@please.com> wrote in message
news:Vr****************@fe04.usenetserver.com...
How can I made time released ASP code? I want to make section of code
viewable after a certain date. Something to this effect, but this does
not work right:
if now() >= "6/24/2005" then
Response.Write ( "here is my new html" )
else
Response.Write ( "for now just show the current information" )
end if

Why get strings involved in it at all?

If now () > dateserial (2005,6,24) then...

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
Jul 22 '05 #7
Roland Hall wrote on 06 mei 2005 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> wrote in message
: Roland Hall wrote on 06 mei 2005 in
: > Since this is running server-side I don't see a need to make it an ISO
: > standard.
:
: What you do on your own site is for your taste.
:
: What you advise here should be as general as possible.

How can that date be interpreted any other than mm/dd/yyyy? It's on the
server, and if the server is in the US, it works for everyone worldwide.
Client-side, I would agree with you. Server-side, I do not.


Why do you suppose everyone's server is in the USA?

The localisation configuration of even a server in the US can be set to the
owners tastes and requirements.

If you answer on usenet your answer are not only to the OP but your advice
goes to many others.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #8
"Roland Hall" <nobody@nowhere> wrote in message
news:eF*************@TK2MSFTNGP09.phx.gbl...
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:OV**************@TK2MSFTNGP09.phx.gbl...
:
: Date literals should be delimited with #. Here's a reference:
:
http://msdn.microsoft.com/library/en...ndamentals.asp

I couldn't find a date literal listed except under isDate.


Whoops. Here's the right link:
http://msdn.microsoft.com/library/en...sconstants.asp
Jul 22 '05 #9
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
: Roland Hall wrote on 06 mei 2005 in
: microsoft.public.inetserver.asp.general:
:
: > "Evertjan." <ex**************@interxnl.net> wrote in message
: >: Roland Hall wrote on 06 mei 2005 in
: >: > Since this is running server-side I don't see a need to make it an
ISO
: >: > standard.
: >:
: >: What you do on your own site is for your taste.
: >:
: >: What you advise here should be as general as possible.
: >
: > How can that date be interpreted any other than mm/dd/yyyy? It's on the
: > server, and if the server is in the US, it works for everyone worldwide.
: > Client-side, I would agree with you. Server-side, I do not.
: >
:
: Why do you suppose everyone's server is in the USA?

I don't. Do you suppose everyone's server is outside the USA?

: The localisation configuration of even a server in the US can be set to
the
: owners tastes and requirements.

True but they may not have a lot of hosting if it's set to anything foreign.

: If you answer on usenet your answer are not only to the OP but your advice
: goes to many others.

Perhaps but it was only directed at one. However, for the sake of argument,
I'll concede.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #10
"Chris Hohmann" wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
: "Roland Hall" <nobody@nowhere> wrote in message
: news:eF*************@TK2MSFTNGP09.phx.gbl...
: > "Chris Hohmann" <no****@thankyou.com> wrote in message
: > news:OV**************@TK2MSFTNGP09.phx.gbl...
: > :
: > : Date literals should be delimited with #. Here's a reference:
: > :
: >
http://msdn.microsoft.com/library/en...ndamentals.asp
: >
: > I couldn't find a date literal listed except under isDate.
:
: Whoops. Here's the right link:
: http://msdn.microsoft.com/library/en...sconstants.asp

Thanks Chris. I thought I was going crazier and it's not time yet.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #11

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

Similar topics

11
2123
by: Cameron Laird | last post by:
*The Chronicle of Higher Education*, which is more-or-less authoritative for US university administrations, is spon- soring a discussion on the place of open-source in universities ("... are such...
18
5269
by: bart_nessux | last post by:
I need a script to call several functions at the same time. How does one call more than one function simultaneously?
15
2317
by: cody | last post by:
We have a huge project, the solutuion spans 50 projects growing. Everytime I want to start the project I have to wait nearly over 1 minute for the compiler to complete building. This is...
77
4502
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
17
3329
by: steve | last post by:
I am writing for game application. Performance is an issue. Any advise would be appreiciated.
13
4354
by: Steve Jorgensen | last post by:
Does this sound familliar to anyone? Regardless of the fact that you have been programming in Access for umpteen years, you still are overly optimistic when it comes to estimating time. The...
7
2880
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by...
4
2198
by: Ravi Ambros Wallau | last post by:
Hi: We developed a set of ASP.NET Web Applications that never runs in stand-alone mode, but always inside a portal (Rainbow Portal). All modules are copied on that portal. My question is: load...
6
1668
by: DarkBlue | last post by:
My application makes several connections to a remote database server via tcp/ip. Usually all is fine,but occasionally the server is down or the internet does not work and then there is the 30 sec...
1
5562
by: sanjupommen | last post by:
I am in the process of exploring the possibility of providing our products on databases other than Oracle.I am able to migrate the data, procedures etc without too much effort (latest version of DB2...
0
7119
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,...
0
6989
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...
0
7157
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,...
1
6873
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...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
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,...
1
4889
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
285
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...

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.