libtad_models/time/timechange.rs
1use super::DateTime;
2use serde::Deserialize;
3
4#[derive(Deserialize)]
5/// Information about a time change.
6pub struct TimeChange {
7 /// New DST offset in seconds. Value will be empty if there is no DST for this location.
8 pub newdst: Option<i32>,
9
10 /// New time zone offset to UTC in seconds if there is a time zone change for this place.
11 /// Otherwise the value will be empty. Time zone changes happen only very rarely, so the field
12 /// will be empty on most occasions.
13 pub newzone: Option<i32>,
14
15 /// New total offset to UTC in seconds.
16 pub newoffset: i32,
17
18 /// Time stamp of transition in UTC time, formatted as ISO 8601 time.
19 ///
20 /// Example: 2011-03-27T01:00:00
21 pub utctime: String,
22
23 /// Local time before transition, formatted as ISO 8601 time.
24 ///
25 /// Example: 2011-03-27T02:00:00
26 pub oldlocaltime: String,
27
28 /// Local time after transition, formatted as ISO 8601 time.
29 ///
30 /// Example: 2011-03-27T03:00:00
31 pub newlocaltime: String,
32
33 /// Verbose representation of the time stamps.
34 pub verbose: Option<VerboseTimeChange>,
35}
36
37#[derive(Deserialize)]
38/// Verbose reprsentation of time change time stamps.
39pub struct VerboseTimeChange {
40 /// Time stamp of transition in UTC time, split up into components.
41 pub utctime: DateTime,
42
43 /// Local time before transition, split up into components.
44 pub oldlocaltime: DateTime,
45
46 /// Local time after transition, split up into components.
47 pub newlocaltime: DateTime,
48}