OpenBullet2
OpenBullet2 copied to clipboard
[REQUEST] Milliseconds Support in Time Blocks
they all not support 13 length unix time / milliseconds
Unix time is stored in an int
, not a long
so this is not possible until the long
type is implemented (which is going to take a while).
As a workaround for this you can use the following C# snippet (paste it in the LoliCode tab instead of the block you were using).
If your variable is called unixTime
and holds the unix time in milliseconds as a string, you can get the date as a string like this
string unixTime = "1620656335000";
string date = RuriLib.Functions.Time.TimeConverter
.ToDateTimeUtc(long.Parse(unixTime), isMilliseconds: true).ToString();
CLOG YellowGreen $"Converted date to {date}"
data.MarkForCapture(nameof(date));
If it's not in milliseconds, just put false
instead of true
Is still not available?
Not yet, I will add this when I have some time. Please be patient, I am very busy with work and this is pretty much the only block that can make use of the long
type at the moment
No worries, just cause doing tests I got into trouble twice cause the post request needs Unix time in milliseconds, but yes, are the first two times that I saw it. Thank you for your answer.
Usually you will be just fine appending three zeroes at the end (or 3 random digits) for example using interpolation <time>000