13 lines
423 B
Erlang
13 lines
423 B
Erlang
|
-module(read_utils).
|
||
|
-compile(nowarn_export_all).
|
||
|
-compile(export_all).
|
||
|
|
||
|
read_fixed(<<Int:16, Frac:16>>) -> Int + Frac / 65536.0.
|
||
|
|
||
|
read_fixed_version(<<Int:16, Frac:16>>) -> Int + Frac / 16#1000 / 10.
|
||
|
|
||
|
read_long_datetime(<<SecondsSince1904:64>>) ->
|
||
|
SecondsTo1904 = calendar:datetime_to_gregorian_seconds({{1904,1,1}, {0,0,0}}),
|
||
|
Seconds = SecondsTo1904+SecondsSince1904,
|
||
|
calendar:gregorian_seconds_to_datetime(Seconds).
|