Closed RustedShader closed 8 months ago
The timestamp in lrc file are getting stored according to local timezone and not using UTC time so i am getting different results in lrc files.
At line 188 in get_lyrics_synced_timestamp_lrc function its not using UTC timezone and using my local timezone by default thus output is
lrc_timestamp = datetime.datetime.fromtimestamp(time / 1000.0)
1970-01-01 05:30:02.380000
30:02.38
lrc_timestamp = datetime.datetime.fromtimestamp(time / 1000.0,tz=datetime.timezone.utc)
1970-01-01 00:00:02.380000+00:00
00:02.38
I will be adding this on the next release.
Issue
The timestamp in lrc file are getting stored according to local timezone and not using UTC time so i am getting different results in lrc files.
Problem
At line 188 in get_lyrics_synced_timestamp_lrc function its not using UTC timezone and using my local timezone by default thus output is
Fix
Instead of using
lrc_timestamp = datetime.datetime.fromtimestamp(time / 1000.0)
Output
1970-01-01 05:30:02.380000
Full Output
30:02.38
You can use
lrc_timestamp = datetime.datetime.fromtimestamp(time / 1000.0,tz=datetime.timezone.utc)
Output
1970-01-01 00:00:02.380000+00:00
Full Output
00:02.38