Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added date_time column #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hamsolo474
Copy link

Added date_time column as per TODO,
refactored Unit_Converter.py

Added date_time column as per TODO,
refactored Unit_Converter.py
Fixing typos in README.md
fixed the typo in the main function of weather_scraper.py
else:
return fahrenheit


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was exactly the same as temperature(), so i DRYed it and followed the pattern we used for precipitation.

row_dict['Date'] = date.strftime('%Y/%m/%d')
row_dict['Time'] = time.strftime('%I:%M %p')
row_dict['Date_time'] = ((time-blank)+date).strftime('%Y/%m/%d %I:%M:%S')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strftime will by default read a time and assume the date 1900/01/01, so i subtract that to get to 0000/00/00 and then all thats left is the timedelta of the time, which i then add to the date giving the full datetime

Copy link
Owner

@Karlheinzniebuhr Karlheinzniebuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, can you delete the gitignore changes please? They are specific to your setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants