Fix weekday calculation in get_datetime_from_unix_time for negative times
Fix calculation for negative times to ensure Sundays are wrapped around to '0'
instead of '7', making it consistent with the output for positive times.
(cherry picked from commit aae5f246ff3b29a6a60d438d71523c8cc139be1b)