pub fn parse_ib_timestamp(
s: &str,
session_zone: Option<Tz>,
) -> Option<DateTime<Utc>>Expand description
Reads IB’s text time, as on an execution or a completed order, as an instant.
IB writes such a time as a wall-clock reading and the zone it is in, such as
20261027 12:48:41 Asia/Singapore, where the zone is the gateway host’s, or as
20261027-04:48:41, which is UTC.
- The zone is a tz database name, such as
Asia/Singapore, or one of its aliases, such asUS/EasternorMET. - A time that names no zone is read in
session_zone, the gateway’s zone from the connection handshake (seeIbkrClient::session_zone). Without one, it isNone. A time that names a zone is read in it, whateversession_zoneis. - A zone that is not a tz database name is
None, with awarn!the first time on each thread. Read in a guessed zone, such as UTC, the instant would be off by the zone’s offset, possibly by hours. - A reading in a repeated hour, as clocks go back, is the earlier of its two instants. One
in a skipped hour, as clocks go forward, never showed on a clock, and is
None. - Anything else that does not read as one of these forms is
None, including the-form followed by a zone.