Python Forum
Convert combobox user input in to date with tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert combobox user input in to date with tkinter
#9
from datetime import datetime
 
day, month, year = ('1', 'January', '2000')
mydate = datetime.strptime(f'{day} {month} {year}', '%d %B %Y')
print(mydate.strftime('%d/%m/%Y'))


d29 = list(f'{num:02}' for num in range(1, 30))
print(d29)
Output:
01/01/2000 ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29']
Reply


Messages In This Thread
RE: Convert combobox user input in to date with tkinter - by Yoriz - Jul-01-2020, 09:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGUI] [Solved]Help storing in user input from line edit Extra 2 1,935 May-12-2022, 07:46 PM
Last Post: Extra
  [PyQt] How can I sync Combobox index to other combobox index? nickzsche 2 2,539 Jan-03-2022, 12:29 PM
Last Post: Axel_Erfurt
  Convert tkinter to pyqt razs 6 6,150 Aug-29-2021, 11:08 AM
Last Post: razs
Question [Tkinter] Can I set background color for each item in tkinter Combobox? water 1 5,315 Dec-10-2020, 07:48 PM
Last Post: Larz60+
  [Tkinter] Getting Input from Tkinter Entry juliabrushett 6 21,731 May-30-2020, 03:29 PM
Last Post: Larz60+
  Create an identification code from user input PeroPuri 1 1,987 Apr-11-2020, 11:56 AM
Last Post: Larz60+
  How can a user send a message via Contact Form in tkinter karolp 0 2,497 Apr-08-2020, 08:00 PM
Last Post: karolp
  [PyQt] Python PyQt5 - Change label text dynamically based on user Input ppel123 1 14,009 Mar-20-2020, 07:21 AM
Last Post: deanhystad
  [Tkinter] Tkinter delete combobox content and not the list LagratteCchouette 4 8,788 Dec-29-2019, 11:04 AM
Last Post: LagratteCchouette
  PyQt5: How do you set the user input of a line edit to a specific variable? YoshikageKira 17 12,300 Dec-26-2019, 03:18 PM
Last Post: Denni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020