Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichal Janek
Front End Web Development Techdegree Graduate 30,654 PointsStrptime question
Kenneth mentions when showing strptime() while creating birthday that there is no hour in datetime, yet there are two 0,0 which were not typed in the string as it was:
'%Y-%m-%d' meaning we did not get hours back but why are those 0,0 there?
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsA datetime
object has both a date and a time portion. If a time is not provided when the datetime
is created, it is assumed to be 0 hour, 0 min: 12:00AM (midnight). The format guidance string is only used to interpret the source string. As long as there is sufficient information in the source string to create a datetime
object based on the guidance string, then all other parameters are assumed to be zero.
Post back if this isn't clear enough.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsCan you explain clearer?