pub struct TimestampMicros(/* private fields */);
Expand description
A i64
timestamp expressed as microseconds since the UNIX epoch (UTC).
§Examples
use questdb::ingress::TimestampMicros;
let ts = TimestampMicros::now();
or
use questdb::ingress::TimestampMicros;
let ts = TimestampMicros::new(1695312859886554);
or
use questdb::ingress::TimestampMicros;
let ts = TimestampMicros::from_systemtime(std::time::SystemTime::now())?;
or
use questdb::ingress::TimestampMicros;
#[cfg(feature = "chrono_timestamp")]
let ts = TimestampMicros::from_datetime(chrono::Utc::now());
Implementations§
Source§impl TimestampMicros
impl TimestampMicros
Sourcepub fn new(micros: i64) -> Self
pub fn new(micros: i64) -> Self
Create a new timestamp from the given number of microseconds since the UNIX epoch (UTC).
pub fn from_datetime<T: TimeZone>(dt: DateTime<T>) -> Self
pub fn from_systemtime(time: SystemTime) -> Result<Self>
Trait Implementations§
Source§impl Clone for TimestampMicros
impl Clone for TimestampMicros
Source§fn clone(&self) -> TimestampMicros
fn clone(&self) -> TimestampMicros
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TimestampMicros
impl Debug for TimestampMicros
Source§impl From<TimestampMicros> for Timestamp
impl From<TimestampMicros> for Timestamp
Source§fn from(ts: TimestampMicros) -> Self
fn from(ts: TimestampMicros) -> Self
Converts to this type from the input type.
Source§impl From<TimestampNanos> for TimestampMicros
impl From<TimestampNanos> for TimestampMicros
Source§fn from(ts: TimestampNanos) -> Self
fn from(ts: TimestampNanos) -> Self
Converts to this type from the input type.
Source§impl TryFrom<Timestamp> for TimestampMicros
impl TryFrom<Timestamp> for TimestampMicros
Source§impl TryFrom<TimestampMicros> for TimestampNanos
impl TryFrom<TimestampMicros> for TimestampNanos
impl Copy for TimestampMicros
Auto Trait Implementations§
impl Freeze for TimestampMicros
impl RefUnwindSafe for TimestampMicros
impl Send for TimestampMicros
impl Sync for TimestampMicros
impl Unpin for TimestampMicros
impl UnwindSafe for TimestampMicros
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