Receiving current local time
This commit is contained in:
parent
ca6e12c9e0
commit
599b027d19
6 changed files with 94 additions and 30 deletions
|
@ -3,11 +3,17 @@
|
|||
|
||||
use std::error::Error;
|
||||
|
||||
use chrono::Timelike;
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let ui = AppWindow::new()?;
|
||||
|
||||
let now = chrono::Local::now();
|
||||
let offset = now.hour() * 3600 + now.minute() * 60 + now.second();
|
||||
ui.invoke_update_record_offset(offset as i32);
|
||||
|
||||
ui.run()?;
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue