I want to read date time from ms access database .
the column is of datatype DATETIME and value is : 1/27/12 5:10 PM
<html>
<body>
<%
Dim Conn
Dim Rs
Dim sql
Dim sConnection
Dim Today as Date //this gives error - unexpected end of file , i want to display current date and time ???
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
filepath= Server.MapPath ("mydb.mdb")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filepath
Conn.Open(sConnection)
sql="select * from items;"
Set Rs = Conn.Execute(sql)
if Rs.EOF then
Response.write("No records found")
else
do until rs.eof
ctime = rs("itemadditiondatetime")
Response.write("<br/>Time : <input name='dateandtime[]' value=" & ctime & "/>" & ctime )
rs.movenext
loop
end if
Rs.Close
Conn.Close
Set Rs = Nothing
Set Conn = Nothing
%>
</body>
</html>
In all text boxes only date is displayed ( 1/27/12 ) , time is not being displayed , but when I display without text box then whole datetime is displayed. also how do i get date and time separately in two text boxes.
Also , I need to format date as yyyy-mm-dd.