Convert to int and format for example:

time.strftime( '%a %d-%b-%Y %H:%M:%S', time.localtime(int(f.Value)))

where f is a field from ado.

                BArry

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of K�ri
> Har�arson
> Sent: 16 May 2001 08:42
> To: [EMAIL PROTECTED]
> Subject: Dates in MS SQL via ADO anyone ?
>
>
> Can someone tell me how to convert an adDBTimeStamp
> to something useful after I retrieve it ?
>
> # The following code tries to print a column
> of dates from an SQL table but all I get is
> a column of '<' signs :
>
> sql= "select * from holiydays"
> rs,result = DBC.Execute(sql)
>
> #This code lists it a being of type adDBTimeStamp
> #for x in range(rs.Fields.Count):
> #     Response.Write(rs.Fields.Item(x).Name)
> #     Response.Write(rs.Fields.Item(x).Type)
> #     Response.Write("<br>")
>
> rs.MoveFirst()
> while not rs.EOF:
>       day= rs("Day") # of type adDBTimeStamp
>       Response.write(str(day)) # This returns a single '<'
>       Response.Write("<br>")
>       rs.MoveNext()
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython
>
>

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to