diff options
| author | marcellus <msimon_fr@hotmail.com> | 2024-04-15 11:10:37 +0200 |
|---|---|---|
| committer | marcellus <msimon_fr@hotmail.com> | 2024-04-15 11:10:37 +0200 |
| commit | c47cb5b7a8854d409bf851c8d406a70fe404b021 (patch) | |
| tree | bfb9bae05eb2b3d0243b732846e39377fd92c177 /cswatch.c | |
Diffstat (limited to 'cswatch.c')
| -rw-r--r-- | cswatch.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cswatch.c b/cswatch.c new file mode 100644 index 0000000..7d1103f --- /dev/null +++ b/cswatch.c @@ -0,0 +1,21 @@ +#include <time.h> +#include <stdio.h> +#include <stdlib.h> + +int main(void) +{ + time_t curtime; + struct tm* utctime; + double swatchTime; + + curtime = time(NULL); + utctime = gmtime(&curtime); + + swatchTime = (((utctime->tm_hour + 1) % 24) * 60 + + utctime->tm_min) * 60 + utctime->tm_sec; + swatchTime /= 84.6; + + printf("%3.2f", swatchTime); + + return EXIT_SUCCESS; +} |
