Merge pull request #1797 from B0pol/published_utc

Use UTC for published date
pull/1817/head
TheFrenchGhosty 4 years ago committed by GitHub
commit 705e4fca06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -517,7 +517,7 @@ struct Video
end end
def published : Time def published : Time
info["microformat"]?.try &.["playerMicroformatRenderer"]?.try &.["publishDate"]?.try { |t| Time.parse(t.as_s, "%Y-%m-%d", Time::Location.local) } || Time.local info["microformat"]?.try &.["playerMicroformatRenderer"]?.try &.["publishDate"]?.try { |t| Time.parse(t.as_s, "%Y-%m-%d", Time::Location::UTC) } || Time.utc
end end
def published=(other : Time) def published=(other : Time)

Loading…
Cancel
Save