Hey!
I have a site set up where I fetch the news out of a specified forum,
and the news date is the Start_date of the thread. However, the posted
date currently shows up as "mm/dd/yyyy hh:mm:ss", whereas I'd like to
have it in some sort of long format (e.g. August 7, 2005) and without
the time (only the date).
The date is fetched from the Access database, so it will first need to
be converted from a string to some sort of date variable, right? And
what happens after that? All I can find online about formatting is how
to change the date from US to normal date format (and I can't even get
that to work, presumably because the date as fetched from Access is of
the wrong type).
Any help appreciated. Thank you!
Here is the code I use right now:
<!-- ASP code to fetch news -->
<%
sql="select Subject, Start_date, Topic_ID from tblTopic where Forum_ID=2 order by Start_date desc"
set rsTopic = DBConn.Execute(sql)
rsTopic.MoveFirst()
if err.number=0 then
while (not rsTopic.EOF)
%>
<!-- Subject -->
<b><% =rsTopic("Subject") %></b><br>
<!-- Date -->
<%
set newsdate = rsTopic("Start_date")
%>
Posted on <% =newsdate %><br>
<%
sql="select Message from tblThread where Topic_ID=" & rsTopic("Topic_ID")
set rsThread = DBConn.Execute(sql)
rsThread.MoveFirst()
%>
<!-- News item -->
<% =rsThread("Message") %><br>
<br>
<br>
<br>
<%
rsTopic.MoveNext()
wend
else
%>
An error has occured
<%
end if
%>
<%
rsThread.close()
rsTopic.close()
DBConn.close
set DBConn=Nothing
%>
|