On Wednesday 13 May 2009 11:26:03 am johnf wrote:
> I have a dDateTextBox that holds birthdays.  My problem is the program is
> saving the date incorrectly.  I set the date to '12/12/1970'  and I
> save  '12/12/2070' to database.  Which is one century wrong.
>
> What am I doing wrong???  How do I fix this?

In dDateTextBox.py

def setDate(self, dt):
                """Sets the Value to the passed date if this is holding a date 
value, or
                sets the date portion of the Value if it is a datetime.
                """
                val = self.Value
                if isinstance(val, datetime.datetime):
                        self.Value = val.replace(year=dt.year, month=dt.month, 
day=dt.day)
                else:
                        self.Value = dt
                        print self.Value
                self.flushValue()

In the above method dt = datetime.date(1989,5,9) and self.Value prints
datetime.date(2089,5,9)

-- 
John Fabiani
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/200905131158.46407.jfabi...@yolo.com

Reply via email to