On Fri, May 28, 2010 at 7:50 AM, Bleve <carl.i...@gmail.com> wrote:
>
> my_date = self.date.GetValue()
> isodate = my_date.isoformat()
>
>
> The error :
> AttributeError: 'DateTime' object has no attribute 'isoformat' - I'm
> trying to insert this into a MySQL database using MySQLdb so the ISO
> format is kinda important!
>
> Is the wx.DateTime not the same as a normal python datetime? Can
> anyone tell me what I've got wrong?
No, they are not the same they are two completely different classes.
Though they have the same purpose.
See wx.DateTime.Format
http://docs.wxwidgets.org/2.8/wx_wxdatetime.html
Cody
--------------------------------------------------
From: "Bleve" <carl.i...@gmail.com>
Sent: Friday, May 28, 2010 1:50 PM
To: "wxPython-users" <wxpytho...@googlegroups.com>
Subject: [wxPython-users] datetime - no attribute 'isoformat'?
> G'day,
> I'm a newbie to wxPython, this is probably something really dumb on my
> part but I'm stuck and have been googling to no avail for some time
> now.
>
> My code :
>
> import time
> import datetime
> import wx
> .
> .
> .
> self.date = wx.DatePickerCtrl(self, -1)
>
> .
> .
> .
>
> my_date = self.date.GetValue()
> isodate = my_date.isoformat()
>
Try:
isodate = mydate.FormatISODate()
>
> The error :
> AttributeError: 'DateTime' object has no attribute 'isoformat' - I'm
> trying to insert this into a MySQL database using MySQLdb so the ISO
> format is kinda important!
>
> Is the wx.DateTime not the same as a normal python datetime? Can
> anyone tell me what I've got wrong?
> Python 2.6 on Win32 (XP) and wxPython 2.8.10.1
>
> Thank you,
>
> Carl
>
>
>
> --
> To unsubscribe, send email to wxPython-user...@googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en
>