Dim BC As ByteConverterDim hexNow As String
hexNow = BC.HexFromBytes(BC.LongsToBytes(ArrayAs Long(DateTime.Now)))
Log(hexNow)
Requires the ByteConverter library
P.S.
"Better" code:
B4X:
Dim HexNow As String
HexNow = HexStrFromLong(DateTime.Now)
Log("Now hex: " & HexNow)
'Requires the ByteConverter library
Public Sub HexStrFromLong(Value As Long) As StringDim BC As ByteConverterReturn BC.HexFromBytes(BC.LongsToBytes(ArrayAs Long(Value)))
EndSub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.