mirror of
https://github.com/SmallPond/MIT6.828_OS.git
synced 2026-02-03 11:03:16 +08:00
21 lines
316 B
C
21 lines
316 B
C
#include "types.h"
|
|
#include "user.h"
|
|
#include "date.h"
|
|
|
|
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
struct rtcdate r;
|
|
|
|
if (date(&r)) {
|
|
printf(2, "date failed\n");
|
|
exit();
|
|
}
|
|
|
|
// your code to print the time in any format you like...
|
|
printf(1, "%d-%d-%d %d:%d\n",r.year, r.month, r.day, r.hour, r.minute);
|
|
exit();
|
|
}
|