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

TimeStamp #121

Open
maserowik opened this issue Jan 6, 2019 · 3 comments
Open

TimeStamp #121

maserowik opened this issue Jan 6, 2019 · 3 comments

Comments

@maserowik
Copy link

I finally had some free time to completely redo my PiClock.
Fantastic work on the upgrade!!!

I do have a time stamp question. Is there a way to use 12 hour time instead of 24 hour time on the radar screen and the Sun Set?

Thanks
Mike

@togatown
Copy link
Contributor

togatown commented Jan 8, 2019

If you have unaltered code, open PyQtPiClock.py and go to line 285:

if "sunriseTime" in wxdata["daily"]["data"][0]:

if "sunriseTime" in wxdata["daily"]["data"][0]: bottomText += (Config.LSunRise + "{0:%H:%M}".format(datetime.datetime.fromtimestamp( wxdata["daily"]["data"][0]["sunriseTime"])) + Config.LSet + "{0:%H:%M}".format(datetime.datetime.fromtimestamp( wxdata["daily"]["data"][0]["sunsetTime"])))

Change "{0:%H:%M}" to "{0:%I:%M}" if you just want the time or "{0:%I:%M %p}" if you want to display AM/PM as well.

@n0bel
Copy link
Owner

n0bel commented Feb 1, 2019

Possibly, it makes sense to move items like this to the config.

@BertLindeman
Copy link
Contributor

This issue alone would be a few lines update on PyQtPiClock.py and on the Config-Example's
@n0bel Would you want a separate pull request for this? It may be that @ScottChapman might be taking this along on #125
Or even make another item to concentrate adding Config variables to move data from the program into the Config
Would gladly add a pull-request for this.
Propose as variablename LtopDateformat with as default:
"{0:%A %B} {0.day}<sup>{1}</sup> {0.year}"
L for Locale . . .
Suggestion for contitental Europe might be
'{0:%A %e}{1} {0:%B} {0.year}'
Drop here 'sup' but KEEP the {1} to prevent substitution error.

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

No branches or pull requests

4 participants