Date formats in webpages

Discussion in 'ASP General' started by Geoff Wickens, Aug 10, 2003.

  1. I am new to using ASP and am trying to develop a site for the band I am a
    member of. The data for our bookings is held in an Access database and I can
    manipulate the date format as much as I like in Access but it doesn't make
    any difference to what appears in my webpage.

    The page is http://www.bedfordtownband.org.uk/calendar.asp

    I want to get dates appearing as for example:

    Sun 10 Aug 2003.

    This is easy to achieve in Access and I have done so. However, I don't seem
    to have any control over how the date appears in the asp page. To get the
    day appearing which is important to me I have had to enter this as a field
    in its own right, not really what I want to do. The code I use to produce
    the calendar part of the page is as below:

    <table width="100%" border="2" cellpadding="5">
    <tr>
    <td width="19%"><font size="1"><b>Date</b></font></td>
    <td width="16%"><font size="1"><b>Band</b></font></td>
    <td width="19%"><font size="1"><b>Venue</b></font></td>
    <td width="16%"><font size="1"><b>Time</b></font></td>
    <td width="30%"><font size="1"><b>Notes</b></font></td>
    </tr>
    <%
    Set Catalog=Server.CreateObject("ADODB.Recordset")
    Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
    Do WHILE NOT Catalog.EOF
    Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") & " "
    & Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band") &
    "</font></td><td><font size='1'>" & Catalog("venue") &
    "</font></td><td><font size='1'>" & Catalog("time") & "</font></td><td><font
    size='1'>" & Catalog("notes") & "</font></td></tr>"

    Catalog.MoveNext
    Loop
    %>
    </table>

    I imagine there must be a way of doing this in ASP but I can't find it! If
    anyone can help with this I would be very grateful indeed.

    Geoff Wickens
    Bedford Town Band
     
    Geoff Wickens, Aug 10, 2003
    #1
    1. Advertising

  2. Geoff Wickens

    Alan Guest

    You have to format the date after you retrieve it. Look up the functions
    WeekdayName() and FormatDateTime() in MSDN.

    Regards,

    Alan

    "Geoff Wickens" <> wrote in message
    news:Q2pZa.114$...
    > I am new to using ASP and am trying to develop a site for the band I am a
    > member of. The data for our bookings is held in an Access database and I

    can
    > manipulate the date format as much as I like in Access but it doesn't make
    > any difference to what appears in my webpage.
    >
    > The page is http://www.bedfordtownband.org.uk/calendar.asp
    >
    > I want to get dates appearing as for example:
    >
    > Sun 10 Aug 2003.
    >
    > This is easy to achieve in Access and I have done so. However, I don't

    seem
    > to have any control over how the date appears in the asp page. To get the
    > day appearing which is important to me I have had to enter this as a field
    > in its own right, not really what I want to do. The code I use to produce
    > the calendar part of the page is as below:
    >
    > <table width="100%" border="2" cellpadding="5">
    > <tr>
    > <td width="19%"><font size="1"><b>Date</b></font></td>
    > <td width="16%"><font size="1"><b>Band</b></font></td>
    > <td width="19%"><font size="1"><b>Venue</b></font></td>
    > <td width="16%"><font size="1"><b>Time</b></font></td>
    > <td width="30%"><font size="1"><b>Notes</b></font></td>
    > </tr>
    > <%
    > Set Catalog=Server.CreateObject("ADODB.Recordset")
    > Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
    > Do WHILE NOT Catalog.EOF
    > Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") & "

    "
    > & Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band") &
    > "</font></td><td><font size='1'>" & Catalog("venue") &
    > "</font></td><td><font size='1'>" & Catalog("time") &

    "</font></td><td><font
    > size='1'>" & Catalog("notes") & "</font></td></tr>"
    >
    > Catalog.MoveNext
    > Loop
    > %>
    > </table>
    >
    > I imagine there must be a way of doing this in ASP but I can't find it!

    If
    > anyone can help with this I would be very grateful indeed.
    >
    > Geoff Wickens
    > Bedford Town Band
    >
    >
     
    Alan, Aug 10, 2003
    #2
    1. Advertising

  3. Geoff Wickens

    Alan Guest

    Here is a link to the MSDN library online:
    http://msdn.microsoft.com/library/default.asp

    Alan


    "Alan" <> wrote in message
    news:...
    > You have to format the date after you retrieve it. Look up the functions
    > WeekdayName() and FormatDateTime() in MSDN.
    >
    > Regards,
    >
    > Alan
    >
    > "Geoff Wickens" <> wrote in message
    > news:Q2pZa.114$...
    > > I am new to using ASP and am trying to develop a site for the band I am

    a
    > > member of. The data for our bookings is held in an Access database and I

    > can
    > > manipulate the date format as much as I like in Access but it doesn't

    make
    > > any difference to what appears in my webpage.
    > >
    > > The page is http://www.bedfordtownband.org.uk/calendar.asp
    > >
    > > I want to get dates appearing as for example:
    > >
    > > Sun 10 Aug 2003.
    > >
    > > This is easy to achieve in Access and I have done so. However, I don't

    > seem
    > > to have any control over how the date appears in the asp page. To get

    the
    > > day appearing which is important to me I have had to enter this as a

    field
    > > in its own right, not really what I want to do. The code I use to

    produce
    > > the calendar part of the page is as below:
    > >
    > > <table width="100%" border="2" cellpadding="5">
    > > <tr>
    > > <td width="19%"><font size="1"><b>Date</b></font></td>
    > > <td width="16%"><font size="1"><b>Band</b></font></td>
    > > <td width="19%"><font size="1"><b>Venue</b></font></td>
    > > <td width="16%"><font size="1"><b>Time</b></font></td>
    > > <td width="30%"><font size="1"><b>Notes</b></font></td>
    > > </tr>
    > > <%
    > > Set Catalog=Server.CreateObject("ADODB.Recordset")
    > > Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
    > > Do WHILE NOT Catalog.EOF
    > > Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day") &

    "
    > "
    > > & Catalog("date") & "</font></td><td><font size='1'>" & Catalog("band")

    &
    > > "</font></td><td><font size='1'>" & Catalog("venue") &
    > > "</font></td><td><font size='1'>" & Catalog("time") &

    > "</font></td><td><font
    > > size='1'>" & Catalog("notes") & "</font></td></tr>"
    > >
    > > Catalog.MoveNext
    > > Loop
    > > %>
    > > </table>
    > >
    > > I imagine there must be a way of doing this in ASP but I can't find it!

    > If
    > > anyone can help with this I would be very grateful indeed.
    > >
    > > Geoff Wickens
    > > Bedford Town Band
    > >
    > >

    >
    >
     
    Alan, Aug 10, 2003
    #3
  4. Many thanks for the great assistance. I have now got it working!

    Geoff


    "Alan" <> wrote in message
    news:...
    > Here is a link to the MSDN library online:
    > http://msdn.microsoft.com/library/default.asp
    >
    > Alan
    >
    >
    > "Alan" <> wrote in message
    > news:...
    > > You have to format the date after you retrieve it. Look up the functions
    > > WeekdayName() and FormatDateTime() in MSDN.
    > >
    > > Regards,
    > >
    > > Alan
    > >
    > > "Geoff Wickens" <> wrote in message
    > > news:Q2pZa.114$...
    > > > I am new to using ASP and am trying to develop a site for the band I

    am
    > a
    > > > member of. The data for our bookings is held in an Access database and

    I
    > > can
    > > > manipulate the date format as much as I like in Access but it doesn't

    > make
    > > > any difference to what appears in my webpage.
    > > >
    > > > The page is http://www.bedfordtownband.org.uk/calendar.asp
    > > >
    > > > I want to get dates appearing as for example:
    > > >
    > > > Sun 10 Aug 2003.
    > > >
    > > > This is easy to achieve in Access and I have done so. However, I don't

    > > seem
    > > > to have any control over how the date appears in the asp page. To get

    > the
    > > > day appearing which is important to me I have had to enter this as a

    > field
    > > > in its own right, not really what I want to do. The code I use to

    > produce
    > > > the calendar part of the page is as below:
    > > >
    > > > <table width="100%" border="2" cellpadding="5">
    > > > <tr>
    > > > <td width="19%"><font size="1"><b>Date</b></font></td>
    > > > <td width="16%"><font size="1"><b>Band</b></font></td>
    > > > <td width="19%"><font size="1"><b>Venue</b></font></td>
    > > > <td width="16%"><font size="1"><b>Time</b></font></td>
    > > > <td width="30%"><font size="1"><b>Notes</b></font></td>
    > > > </tr>
    > > > <%
    > > > Set Catalog=Server.CreateObject("ADODB.Recordset")
    > > > Catalog.open "SELECT * FROM qrybookings", "DSN=calendar"
    > > > Do WHILE NOT Catalog.EOF
    > > > Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("day")

    &
    > "
    > > "
    > > > & Catalog("date") & "</font></td><td><font size='1'>" &

    Catalog("band")
    > &
    > > > "</font></td><td><font size='1'>" & Catalog("venue") &
    > > > "</font></td><td><font size='1'>" & Catalog("time") &

    > > "</font></td><td><font
    > > > size='1'>" & Catalog("notes") & "</font></td></tr>"
    > > >
    > > > Catalog.MoveNext
    > > > Loop
    > > > %>
    > > > </table>
    > > >
    > > > I imagine there must be a way of doing this in ASP but I can't find

    it!
    > > If
    > > > anyone can help with this I would be very grateful indeed.
    > > >
    > > > Geoff Wickens
    > > > Bedford Town Band
    > > >
    > > >

    > >
    > >

    >
    >
     
    Geoff Wickens, Aug 10, 2003
    #4
    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. Andrew J Gray

    asp.net date/time formats

    Andrew J Gray, Mar 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    482
    Andrew J Gray
    Mar 4, 2004
  2. David Jessee

    date to text formats - neverending story

    David Jessee, Apr 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    369
    Leo Muller
    Apr 29, 2004
  3. Martin Eyles

    Date Formats of Date in Database

    Martin Eyles, Mar 28, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    1,785
    Martin Eyles
    Mar 29, 2006
  4. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,374
    Michael Borgwardt
    May 30, 2004
  5. Aparna
    Replies:
    2
    Views:
    567
    Martin Gregorie
    Jun 14, 2007
Loading...

Share This Page