leegold wrote: > Hi, > > Given an MS-Access table with a date type field with a value of: > 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field. > > I want to print exactly what's in the field, ie. "12:00:00 AM".
Do you understand that this is not really what's present in that field? What's present in the field is a floating point number. The number happens to represent the number of days since December 30, 1899. Hours, minutes, and seconds are stored as the decimal part of the fraction. One hour is 0.04166666..., for example. Access formats it as "12:00:00 AM" for you, because that's the local time format on your machine, and as Bob said, Access omits the date portion in the formatting if the number is less than 1.0. That's part of the Access application, NOT the database engine. > What's printed is: 12/30/0/ 00:00:00 > > How do I get exactly what's in the field? Note, there could be any legal > date time in the field - I'm trying in all cases to get exactly what's > in the field...or to put it another way, exactly what I see when I open > Access and look. > The value of the "Value" property is a PyTime object. It supports the Format method. To get the time only, use: v = oRS.Fields(dt).Value print v.Format( "%H:%M:%S %p") See: http://aspn.activestate.com/ASPN/docs/ActivePython/2.3/pywin32/PyTime__Format_meth.html -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32