-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSystemClock.cs
More file actions
26 lines (23 loc) · 785 Bytes
/
SystemClock.cs
File metadata and controls
26 lines (23 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
namespace AlweStats {
public static class SystemClock {
private static Block clockBlock = null;
public static Block Start() {
clockBlock = new Block(
"SystemClock",
Main.systemClockColor.Value,
Main.systemClockSize.Value,
Main.systemClockPosition.Value,
Main.systemClockMargin.Value
);
return clockBlock;
}
public static void Update() {
if (clockBlock != null) {
string clockFormat = Main.systemClockFormat.Value ? "hh:mm tt" : "HH:mm";
string irlClock = DateTime.Now.ToString(clockFormat);
clockBlock.SetText(irlClock);
}
}
}
}