Zum Inhalt springen

Modul:TwitterSnowflake: Unterschied zwischen den Versionen

fix weird edge case with 574608900537761792 returning a date of April 11, 2011
(convert user-inputted epoch to number)
(fix weird edge case with 574608900537761792 returning a date of April 11, 2011)
Zeile 17: Zeile 17:
         else hiexp = hiexp + 1 end
         else hiexp = hiexp + 1 end
     end
     end
    hi = hi * 10^(hiexp-1)
     local timestamp = math.floor((hi * 1024 + math.floor(lo / 4194304)) / 1000) + epoch
     local timestamp = math.floor((hi * 1024 + math.floor(lo / 4194304)) / 1000) + epoch
     return os.date(format, timestamp)
     return os.date(format, timestamp)
Anonymer Benutzer