[Zope] Getting the day from a Timestamp / gvibda
Oliver Sturm
sturm@oliver-sturm.de
Tue, 22 May 2001 16:35:21 +0200
On 22.05.2001 16:22:13 +0200 Gitte Wange <gitte@mmmanager.org> wrote:
>> >> I have a query returning a timestamp column from my interbase 6
>> >> database using the Going Virtual database adapter. I want to extract
>> >> the values of the day/month/year ... from the variable. I tried this
>> >>
>> >> <dtml-var date_column fmt="%d">
>> >>
>> >> for the day, but it doesn't work, probably because the variable's type
>> >> is not the usual python DateTime. Similarly, this
>> >>
>> >> <dtml-var "_.DateTime(date_column).day()">
>> >
>> > Have you tried with:
>> > <dtml-var "_.DateTime(date_column).strftime('%d')">
>>
>> Yes, I had tried that before. It gives me a "NameError" with the "Error
>> value" being "date_column". Thanks...
>
> Maybe it's the date_column that is wrong???
You were right, but that doesn't change my problem... I had mistyped the
column's name when I retried that version in response to your mail. Now,
what I really get as an error message is an "AttributeError", the "Error
value" being "__int__". I had that before and I think it means that the
variable can't be rendered to an integer, as python thinks it should
because it doesn't know that the variable is supposed to contain a date
value.
Oliver
--
Oliver Sturm / <sturm@oliver-sturm.de>