Fix TimestampTz type to i64 to be compatbile with Postgres

This commit is contained in:
Konstantin Knizhnik
2021-07-13 14:33:20 +03:00
parent 386403dcd1
commit f6705b7a7d
2 changed files with 3 additions and 3 deletions

View File

@@ -96,8 +96,8 @@ pub fn get_current_timestamp() -> TimestampTz {
match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
Ok(n) => {
((n.as_secs() - ((POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * SECS_PER_DAY))
* USECS_PER_SEC
+ n.subsec_micros() as u64) as i64
* USECS_PER_SEC
+ n.subsec_micros() as u64) as i64
}
Err(_) => panic!("SystemTime before UNIX EPOCH!"),
}