Open TomiwaJoseph opened 3 years ago
Are you using the date_pattern
attribute when making your DateEntry
?
Perhaps I'm misunderstanding the problem
This is 2 years later but still a problem... here is some code that produces the error:
import datetime
import tkinter as tk
from tkinter import ttk
from tkcalendar import DateEntry
def get_date():
print(cal.get_date()) # prints '2050-01-01'
root = tk.Tk()
cal = DateEntry(root)
old_date = datetime.date(1950, 1, 1)
cal.set_date(old_date)
cal.pack(padx=10, pady=10)
ttk.Button(root, text='Get date', command=get_date).pack(padx=10, pady=10)
root.mainloop()
Is the only solution to set a date pattern?
If year 1993-02-28 was selected in the DateEntry for example, the get_date() method returns 2093-02-28. If I use the get() method it returns correct date as string but I won't be able to know for example if 3/6/93 means 03-06-1993 or 03-06-2093. Please do help.
Thanks.