Module redblocks::time[][src]

Expand description

Displays the current time.

for formating options see the strftime module

Using the default configuration

formats to “Saturday 06/26/2021 3:41:48 pm”

#[macro_use]
extern crate redblocks;

use redblocks::{time::TimePlugin, Widget};

fn main() {
    let time = Box::new(TimePlugin::default());
    let time = vec![Widget::new(time, 1)];
    
    start_bar!(time);
}

Using a custom format

#[macro_use]
extern crate redblocks;

use redblocks::{time::TimePlugin, Widget};

fn main() {
    let time = TimePlugin::new("%H%M%S"); // formats to "14:23:08"
    let time = vec![Widget::new(time, 1)];

    start_bar!(time);
}

Modules

strftime/strptime-inspired date and time formatting syntax.

Structs

Displays the time