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

Discussion in 'ASP .Net' started by Chumley Walrus, Dec 16, 2004.

  1. 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
     
    Chumley Walrus, Dec 16, 2004
    #1
    1. Advertising

  2. RE: Classic asp date displays- changing over to aspnet date object dis

    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/default.asp?url=/library/en-us/dndotnet/html/datetimecode.asp

    http://www.microsoft.com/downloads/results.aspx?productID=&freetext=datetime&DisplayLang=en
     
    =?Utf-8?B?QnJpYW4gQnJvd24=?=, Dec 16, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary Nelson

    Upgrade from aspnet 1.1 to aspnet 2.0

    Gary Nelson, Oct 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    516
    Gary Nelson
    Oct 14, 2005
  2. Replies:
    7
    Views:
    693
    Juan T. Llibre
    Mar 23, 2007
  3. Brian Schuth
    Replies:
    0
    Views:
    303
    Brian Schuth
    Sep 8, 2003
  4. Alfred Sehmueller
    Replies:
    0
    Views:
    292
    Alfred Sehmueller
    Feb 20, 2004
  5. J. Muenchbourg

    asp.net date objects vs. classic asp date objects

    J. Muenchbourg, Oct 3, 2003, in forum: ASP General
    Replies:
    1
    Views:
    188
    msnews.microsoft.com
    Oct 3, 2003
Loading...

Share This Page