// System Time
// Displays the OS active time since the last boot.

// Set Windows10 to always logoff on shutdown:
// Windows10 Settings (optional ???): Energieoptionen --> Systemeinstellungen --> Schnellstart aktivieren (OFF!)
// Windows10 Settings: Einstellungen --> Konten --> Anmeldeoptionen --> Meine Anmeldeinformationen... (OFF!)
// ...otherwise this plugin will display the time since the last Windows10 'update' ???

// If the above settings will not help...
// >>> Force Windows10 to shutdown (independently from any user/system setting)
//        by using one of these 'configurated links' :
// - shutdown_start - 10_seconds (shutdown Windows10 after 10 seconds...)
// - shutdown_start - 0,5_hours (shutdown Windows10 after 0,5 hours...)
// - shutdown_start - 1,0_hours (etc. ...)
// - shutdown_start - 1,5_hours
// - shutdown_start - 2,0_hours
// - shutdown_start - 2,5_hours
// - shutdown_start - 3,0_hours
// - shutdown_stop (this will just stop the previously activated shutdown time counter...)

slider1:0<0,10,1>-years
slider2:0<0,364,1>-days
slider3:0<0,23,1>-hours
slider4:0<0,59,1>-minutes
slider5:0<0,59,1>-seconds

in_pin:none
out_pin:none

@block
curtime=time_precise();

y=floor(curtime/(86400*365.25));
d=floor((curtime-(y*(86400*365.25)))/86400);
h=floor(curtime/3600)%24;
h2=floor(curtime/3600);
m=floor((curtime-h2*3600)/60);
s=floor(curtime-h2*3600-m*60);

slider1=y;
slider2=d;
slider3=h;
slider4=m;
slider5=s;

@gfx 0 100
gfxSize=min(gfx_w/6|0,gfx_h*2/3|0);
fontsize=gfxSize;
gfx_r=0; gfx_g=1; gfx_b=0; gfx_a=1;
gfx_setfont(1,"Arial", fontsize);
gfx_x=gfx_w/15|0; gfx_y=gfx_h/5|0;
//gfx_printf("%01d:%03d:%02d:%02d:%02d", y, d, h, m, s); // with years...
gfx_printf("%02d:%02d:%02d:%02d", d, h, m, s); // no years...
