pub struct ZdaData {
pub utc_time: Option<NaiveTime>,
pub day: Option<u8>,
pub month: Option<u8>,
pub year: Option<u16>,
pub local_zone_hours: Option<i8>,
pub local_zone_minutes: Option<i8>,
}
Expand description
ZDA - Time & Date - UTC, day, month, year and local time zone
https://gpsd.gitlab.io/gpsd/NMEA.html#_zda_time_date_utc_day_month_year_and_local_time_zone
1 2 3 4 5 6 7
| | | | | | |
$--ZDA,hhmmss.ss,xx,xx,xxxx,xx,xx*hh<CR><LF>
- UTC time (hours, minutes, seconds, may have fractional subseconds)
- Day, 01 to 31
- Month, 01 to 12
- Year (4 digits)
- Local zone description, 00 to +- 13 hours
- Local zone minutes description, 00 to 59, apply same sign as local hours
- Checksum
Fields§
§utc_time: Option<NaiveTime>
§day: Option<u8>
§month: Option<u8>
§year: Option<u16>
§local_zone_hours: Option<i8>
§local_zone_minutes: Option<i8>
Implementations§
source§impl ZdaData
impl ZdaData
sourcepub fn utc_date(&self) -> Option<NaiveDate>
pub fn utc_date(&self) -> Option<NaiveDate>
Get UTC date by day
, month
and year
fields.
Returns None
if any field is None
.
sourcepub fn utc_date_time(&self) -> Option<NaiveDateTime>
pub fn utc_date_time(&self) -> Option<NaiveDateTime>
Get UTC date time by utc_time
, day
, month
, and year
fields.
Returns None
if any field is None
.
sourcepub fn offset(&self) -> Option<FixedOffset>
pub fn offset(&self) -> Option<FixedOffset>
Get chrono::FixedOffset
by local_zone_hours
and local_zone_minutes
fields.
Return Some
if either local_zone_hours
or local_zone_minutes
is Some
.
sourcepub fn local_date_time(&self) -> Option<DateTime<FixedOffset>>
pub fn local_date_time(&self) -> Option<DateTime<FixedOffset>>
Caluculate local datetime
Returns None
if any field is None
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for ZdaData
impl<'de> Deserialize<'de> for ZdaData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<ZdaData> for ZdaData
impl PartialEq<ZdaData> for ZdaData
impl Eq for ZdaData
impl StructuralEq for ZdaData
impl StructuralPartialEq for ZdaData
Auto Trait Implementations§
impl RefUnwindSafe for ZdaData
impl Send for ZdaData
impl Sync for ZdaData
impl Unpin for ZdaData
impl UnwindSafe for ZdaData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more