Hello,
I receive date-time array from HMI device in this form '16092103132021' I would like to separate date time elements in byte values but i get very different results:
16 09 21 03 13 20 21
year month day day-week hr mn sc
I receive date-time array from HMI device in this form '16092103132021' I would like to separate date time elements in byte values but i get very different results:
16 09 21 03 13 20 21
year month day day-week hr mn sc
B4X:
Dim RAF As RandomAccessFile
RAF.Initialize(CurrentDateTime, False)
Dim hex_str As String
hex_str=BC.HexFromBytes(CurrentDateTime) 'just to debug
DWIN_YEAR = RAF.ReadByte(0)
DWIN_MONTH = RAF.ReadByte(1)
DWIN_DAY = RAF.ReadByte(2)
DWIN_WEEK_DAY = RAF.ReadByte(3)
DWIN_HOUR = RAF.ReadByte(4)
DWIN_MINUT = RAF.ReadByte(5)
DWIN_SECOND = RAF.ReadByte(6)
Log(hex_str) 'i get 16092103132021
Log(DWIN_YEAR) 'i get 22 instead of 16