Pummpcomm v2.5.1 Pummpcomm.DateDecoder View Source
Decodes Pummpcomm.History
and Pummpcomm.Cgm
timestamps to NaiveDateTime.t
.
Link to this section Summary
Types
A cgm timestamp binary whose format is described in the following table
A history page long timestamp that contains YYY-MM-DD HH::MM
A history short timestamp that contains only YYY-MM-DD
Functions
decodes a cgm timestamp binary whose format is described in the following table
This function decodes a full date and time as returned by the ReadTime command
Decodes either a short or long history page timestamp
Link to this section Types
A cgm timestamp binary whose format is described in the following table:
+========================================================================+ | BYTE 0 | | 1 | | 2 | | 3 | | MONTH HIGH | HOUR | MONTH LOW | MINUTE | FLAGS | DAY | 2000 + YEAR |
- —————-+————+—————-+————+———-+———-+——————-+ | xx | 0xxxxx | xx | xxxxxx | xxx | xxxxx | 0xxxxxxx | +========================================================================+
history_long_timestamp() :: <<_::16, _::_*24>>
A history page long timestamp that contains YYY-MM-DD HH::MM
+===================================================================================================+ | BYTE 0 | | 1 | | 2 | | | 3 | 4 | | | MONTH HIGH | SECOND | MONTH LOW | MINUTE | FLAGS | HOUR | FLAGS | DAY | FLAGS | 2000 + YEAR |
- —————-+————+—————-+————+———-+———-+———-+—————+———-+——————-+ | xx | xxxxxx | xx | xxxxxx | xxx | xxxxx | xxx | xxxxx | x | xxxxxxx | +===================================================================================================+
A history short timestamp that contains only YYY-MM-DD.
+===========================================+ | BYTE 0 | | 1 | | | MONTH HIGH | DAY | MONTH LOW | YEAR |
- —————-+————+—————-+————-+ | xxx | xxxxx | x | xxxxxxx | +===========================================+
Link to this section Functions
decode_cgm_timestamp(non_neg_integer) :: NaiveDateTime.t
decode_cgm_timestamp(cgm_timestamp) :: NaiveDateTime.t
decodes a cgm timestamp binary whose format is described in the following table:
+========================================================================+ | BYTE 0 | | 1 | | 2 | | 3 | | MONTH HIGH | HOUR | MONTH LOW | MINUTE | FLAGS | DAY | 2000 + YEAR |
- —————-+————+—————-+————+———-+———-+——————-+ | xx | 0xxxxx | xx | xxxxxx | xxx | xxxxx | 0xxxxxxx | +========================================================================+
decode_full_datetime(binary) :: {:ok, NaiveDateTime.t} | {:error, :invalid_time}
This function decodes a full date and time as returned by the ReadTime command
decode_history_timestamp(history_short_timestamp) :: NaiveDateTime.t
decode_history_timestamp(history_long_timestamp) :: NaiveDateTime.t
Decodes either a short or long history page timestamp
Long
+===================================================================================================+ | BYTE 0 | | 1 | | 2 | | | 3 | 4 | | | MONTH HIGH | SECOND | MONTH LOW | MINUTE | FLAGS | HOUR | FLAGS | DAY | FLAGS | 2000 + YEAR |
- —————-+————+—————-+————+———-+———-+———-+—————+———-+——————-+ | xx | xxxxxx | xx | xxxxxx | xxx | xxxxx | xxx | xxxxx | x | xxxxxxx | +===================================================================================================+
Short
+===========================================+ | BYTE 0 | | 1 | | | MONTH HIGH | DAY | MONTH LOW | YEAR |
- —————-+————+—————-+————-+ | xxx | xxxxx | x | xxxxxxx | +===========================================+