Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Classic asp date displays- changing over to aspnet date object displays

Reply
Thread Tools

Classic asp date displays- changing over to aspnet date object displays

 
 
Chumley Walrus
Guest
Posts: n/a
 
      12-16-2004
I'm changing an old classic asp script over to asp.net; it displays
links corresponding to each day of the week

<script runat="server">

Sub Page_Load(s As Object, e As EventArgs)



</script>

<%



'DateTime.Now will be the current date indicator



dim currentDate,noshowyet,numDays,i

currentDate = DateTime.Now

noShowYet = false

if hour(currentDate) < 12 and weekday(currentDate) <> 2 then

currentDate = dateadd("d",-1,currentDate)

elseif hour(currentDate) < 12 then

Response.Write("[ Today's show will be ready by 12:00 pm PST")

noShowYet = true

end if

select case weekday(currentDate)

case 1

numDays = 5

currentDate = dateadd("d",-6,currentDate)

case 2

numDays = 1

case 3

numDays = 2

currentDate = dateadd("d",-1,currentDate)

case 4

numDays = 3

currentDate = dateadd("d",-2,currentDate)

case 5

numDays = 4

currentDate = dateadd("d",-3,currentDate)

case 6

numDays = 5

currentDate = dateadd("d",-4,currentDate)

case 7

numDays = 5

currentDate = dateadd("d",-5,currentDate)

end select

if not noShowYet then

for i=1 to numDays



select case weekday(currentDate)

case 2

Response.Write("[ <A HREF=prMonday.asx>Monday</A> ")

case 3

Response.Write("| <A HREF=prTuesday.asx>Tuesday</A> ")

case 4

Response.Write("| <A HREF=prWednesday.asx>Wednesday</A> ")

case 5

Response.Write("| <A HREF=prThursday.asx>Thursday</A> ")

case 6

Response.Write("| <A HREF=prFriday.asx>Weekend</A> ")

case else

Response.Write("error in select case: invalid day of week")

end select



currentDate = dateadd("d",1,currentDate)

next

end if

%>

where's a good reference to refer to date objects for asp.net (or what
are some of the comparable functions that asp.net uses to parse each
date format)?

Thanks in advance
Chumley

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJpYW4gQnJvd24=?=
Guest
Posts: n/a
 
      12-16-2004
Hi,

The System.DateTime class is very robust in .net. I do not think that you
will have any issues at all porting your code over. I have posted a couple
of links for you to help you get started. If you need more specifc help
please reply to this post.

Hope this helps.

-------------------------------

http://msdn.microsoft.com/library/de...tetimecode.asp

http://www.microsoft.com/downloads/r...DisplayLang=en


 
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
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
Is the aspnet account called "aspnet" for all non-English versions of Windows and IIS? torus@tpg.com.au ASP .Net 7 03-23-2007 04:00 AM
Upgrade from aspnet 1.1 to aspnet 2.0 Gary Nelson ASP .Net 2 10-14-2005 05:16 PM
asp.net date objects vs. classic asp date objects J. Muenchbourg ASP General 1 10-03-2003 06:06 PM
Restricting ASPNET ACLs without breaking ASPNET (newbie-ish) Brian Schuth ASP .Net Security 0 09-08-2003 06:09 PM



Advertisments