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

request: convert times to users local timezones #22213

Closed
zachary-D opened this issue Aug 26, 2019 · 4 comments
Closed

request: convert times to users local timezones #22213

zachary-D opened this issue Aug 26, 2019 · 4 comments
Labels

Comments

@zachary-D
Copy link

@zachary-D zachary-D commented Aug 26, 2019

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2019.08.13
  • I've searched the bugtracker for similar feature requests including closed ones

Description

I'd like youtube-dl to convert upload dates to the users current timezone when substituting for '%(upload_date)s' in output filenames. Twitch in particular (and presumably many more) return their timestamps in UTC, and youtube-dl does not convert them before substitution which leads to the upload date being inconsistent in different timezones. In my case this results in evening streams being labelled as the day after, while morning streams are marked labelled properly. I originally thought this was a bug ( #22173 ), more specific examples of this behavior are available there. Thank you for considering my request!

@zachary-D zachary-D added the request label Aug 26, 2019
@chuckn408
Copy link

@chuckn408 chuckn408 commented Aug 28, 2019

What would have to happen is basically a fork of upload_date to upload_date_local.
upload_date_local would have to::
-get timezone of file
-get timezone of pc
-some arithmetic
-append the adjusted difference between the two as the title

A quick search showed something promising:

from dateutil.tz import tzlocal
datetime.now(tzlocal())

I'll see if I can whip something up in the next day or so.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 28, 2019

This will not work since you don't know the original timezone in general.

@dstftw dstftw closed this Aug 28, 2019
@zachary-D
Copy link
Author

@zachary-D zachary-D commented Aug 29, 2019

I meant the timezone of the downloader, not the recorder

@zachary-D
Copy link
Author

@zachary-D zachary-D commented Aug 30, 2019

To clarify, I was looking to have the date twitch reports (which is in UTC) to the downloader's current timezone.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.