19 if (nargs == 2 &&
strncmp(args[1],
"--help", 7) == 0) {
20 printf(
"Usage: %s\n\n", args[0]);
22 printf(
"\tDisplays the current date and time\n");
23 printf(
"Options (one per invocation):\n");
24 printf(
"\t-f\tforce a time server request to be sent\n");
25 printf(
"\t-d\tset daylight savings time on\n");
26 printf(
"\t-s\tset standard time (not daylight savings)\n");
27 printf(
"\t-a\tset daylight savings to automatic\n");
28 printf(
"\t--help\tdisplay this help and exit\n");
42 if (
strncmp(args[1],
"-f", 3) == 0) {
44 }
else if (
strncmp(args[1],
"-d", 3) == 0) {
46 }
else if (
strncmp(args[1],
"-s", 3) == 0) {
48 }
else if (
strncmp(args[1],
"-a", 3) == 0) {
53 "Try '%s --help' for more information\n",
62 "%s: could not obtain the current date\n",
int32 strncmp(const char *, const char *, int32)
int32 printf(const char *,...)
shellcmd xsh_date(int nargs, char *args[])
#define FALSE
Boolean False(0)
int int32
符号あり32ビット整数(int)
int32 shellcmd
シェルコール関数 返り値の型
int32 fprintf(int, char *,...)
status ascdate(uint32, char *)
unsigned int uint32
符号なし32ビット整数(unsigned int)
status gettime(uint32 *)
1970年1月1日からの経過時間(秒単位)にロケーション(時差)を反映した時間を返す。