Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,851 questions

51,772 answers

573 users

How to get today date timetuple (time tuple) in Python

1 Answer

0 votes
import datetime
 
today = datetime.date.today()     

tt = today.timetuple()   

print('tm_year:', tt.tm_year)     
print('tm_mon:', tt.tm_mon)     
print('tm_mday:', tt.tm_mday)     
print('tm_hour:', tt.tm_hour)     
print('tm_min:', tt.tm_min)     
print('tm_sec:', tt.tm_sec)     
print('tm_wday:', tt.tm_wday)     
print('tm_yday:', tt.tm_yday)     
print('tm_isdst:', tt.tm_isdst) 



'''
run:

tm_year: 2019
tm_mon: 6
tm_mday: 5
tm_hour: 0
tm_min: 0
tm_sec: 0
tm_wday: 2
tm_yday: 156
tm_isdst: -1

'''

 



answered Jun 5, 2019 by avibootz

Related questions

1 answer 202 views
1 answer 162 views
162 views asked Jun 5, 2019 by avibootz
1 answer 183 views
1 answer 227 views
1 answer 150 views
1 answer 156 views
1 answer 176 views
...