diff options
author | Benji Dial <benji6283@gmail.com> | 2021-02-19 23:41:56 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-02-19 23:41:56 -0500 |
commit | 6f1b50a4cc6c232ee505a543f006abb1c6cd33cf (patch) | |
tree | c52a227440af7e3bcd07dea94504e8c2c86c411c /src/user/time | |
parent | eae7442610215e55ea350c65aab4ab3869111014 (diff) | |
download | portland-os-6f1b50a4cc6c232ee505a543f006abb1c6cd33cf.tar.gz |
rtc fixes, time command
Diffstat (limited to 'src/user/time')
-rw-r--r-- | src/user/time/time.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/user/time/time.c b/src/user/time/time.c new file mode 100644 index 0000000..49f6cf5 --- /dev/null +++ b/src/user/time/time.c @@ -0,0 +1,24 @@ +#include <libterm/terminal.h> +#include <knob/time.h> + +static const char *const month_names[] = { + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" +}; + +void main() { + const struct time t = get_time(); + term_addf("TS: 0x%8h\n", t.timestamp); + term_addf("Date: %s %u, %u\n", month_names[t.month - 1], t.day, t.year); + term_addf("Time: %u:%2u:%2u\n", t.hour, t.minute, t.second); +}
\ No newline at end of file |