0

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.
dexta
  • 17
  • 4
  • You're not using `tkcalendar`. – Peter Wood Jun 26 '23 at 07:53
  • @PeterWood import sqlite3 from tkinter import * from tkinter.ttk import Combobox,Treeview,Scrollbar from tkinter import messagebox import datetime import re from tkcalendar import DateEntry,Calendar How is this not tkcalendar – dexta Jun 26 '23 at 07:58
  • [Edit] the question. None of the code you've posted is relevant to your problem. See how to create a [mcve]. – Peter Wood Jun 26 '23 at 08:00
  • Try looking at [How to get the selected date for DateEntry in tkcalendar (Python)?](https://stackoverflow.com/questions/50625818/how-to-get-the-selected-date-for-dateentry-in-tkcalendar-python) – Alias Cartellano Jun 26 '23 at 22:11

0 Answers0