-4

Show current date in the calander

from tkinter import *
from tkcalendar import *
root = Tk()
root.geometry("500x300")

date_field = DateEntry(root, selectmode="day", year=2021, month=12, day=8)
date_field.grid(row=3, column=1, ipadx="100")

root.mainloop()
PCM
  • 2,881
  • 2
  • 8
  • 30
rahuldev
  • 21
  • 2
  • You have completely changed the question. Better post another question instead. – acw1668 Dec 09 '21 at 10:12
  • Does this answer your question? [How do I create a date picker in tkinter?](https://stackoverflow.com/questions/4443786/how-do-i-create-a-date-picker-in-tkinter) – PCM Dec 09 '21 at 10:26
  • 1
    I’m voting to close this question because The question was changed after answers were posted – Reblochon Masque Dec 09 '21 at 10:35
  • It seams to me that someone wants all the answers with no effort at all. Please close this question. – Thyrus Dec 09 '21 at 10:51

2 Answers2

2

One of the way:

...
timeslots = [f'{hr:02}:{mi:02}' for hr in range(24) for mi in range(0, 60, 15)]
kommt_field = ttk.Combobox(root, values=timeslots)
...
acw1668
  • 40,144
  • 5
  • 22
  • 34
-1
from tkinter import *
from tkcalendar import *
root = Tk()
root.geometry("500x300")

date_field = DateEntry(root, selectmode="day"8)
date_field.grid(row=3, column=1, ipadx="100")

root.mainloop()
PCM
  • 2,881
  • 2
  • 8
  • 30
rahuldev
  • 21
  • 2
  • 1
    There is no need to make a self-answer question because this thing has been asked a lot of times. First, check if the question is a duplicate before posting. – PCM Dec 09 '21 at 10:25
  • Also, please remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, can you [edit] your answer to include an explanation of what you're doing and why you believe it is the best approach to your original question? – Jeremy Caney Dec 12 '21 at 00:57