springql-core 0.18.1

SpringQL: Open-source stream processor for IoT devices and in-vehicle computers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// This file is part of https://github.com/SpringQL/SpringQL which is licensed under MIT OR Apache-2.0. See file LICENSE-MIT or LICENSE-APACHE for full license details.

use crate::stream_engine::time::timestamp::SpringTimestamp;

/// Wall-clock timestamp from system clock.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, new)]
pub struct SystemTimestamp;

impl SystemTimestamp {
    pub fn now() -> SpringTimestamp {
        let t = crate::time::NaiveDateTime::utc_now();
        SpringTimestamp::new(t)
    }
}