OpenBullet2 icon indicating copy to clipboard operation
OpenBullet2 copied to clipboard

[Bug]: UnixTimeToDate Int32 overflow

Open holigo1 opened this issue 3 years ago • 3 comments

Version of the software

0.2.0

Operating system

Windows 10

Browser / Native

Chrome 97

What happened?

Conversion of unix time will raise an Int32 Overflow Exception for too high value .

in OpenBullet2/RuriLib/Functions/Time/TimeConverter.cs UnixTimeToDate(... int unixTime ...) should use long

int32 max value is 2147483647 == "Tuesday 19 January 2038 03:14:07" Converting value past this day is impossible.

Stacker, loli and C# are impacted

Relevant LoliCode if needed

BLOCK:ConstantString
  value = "4294692759"
  => VAR @constantStringOutput
ENDBLOCK

BLOCK:UnixTimeToDate
  unixTime = @constantStringOutput
  => VAR @unixTimeToDateOutput
ENDBLOCK

holigo1 avatar Feb 01 '22 21:02 holigo1

Hey, as I replied here https://github.com/openbullet/OpenBullet2/issues/255 I plan to implement the long type among the supported types of OB2 sooner or later, so don't worry, it will definitely be fixed before 2038 😅

openbullet avatar Feb 02 '22 06:02 openbullet

Ok, no stress. I just deactivate the conversion for the time being where I have far far away date.😂 I saw it was not a so straight forward correction. So I preferred to report a bug instead of an ugly PR.

holigo1 avatar Feb 02 '22 08:02 holigo1

👍 nice! Although, do you really think you will still be using OB2 in 16 years? 🤣

openbullet avatar Feb 02 '22 17:02 openbullet