dexta
dexta

Reputation: 37

How do I get the date that the user selects on tkcalendar. DateEntry?

I want to get the date from the user, that they select, so that I may put it into my sql database. I have tried many things, such as getdate() and selection_get() but I can't seem to get my value 'dobentered' to equal the value of the date entered.

self.doblabel=Label(self.master,text="Date of Birth",width=20).grid(row=2,column=0)
        self.cdoblabel=Label(self.master,textvariable=self.cdobtext,width=30).grid(row=2,column=2)
        self.dobentered = DateEntry(self.master,selectmode='day').grid(row=2,column=1)

dobentered = self.dobentered.get_date()

 Preferably the dobentered would be a date but a string would also be fine, I also need to somehow get it into the form YYYY-MM-DD. But i think I could do this afterwards possibly.

Upvotes: 0

Views: 127

Answers (0)

Related Questions