13 /* Get the current time. */
14 curtime
= time (NULL
);
16 /* Convert it to local time representation. */
17 loctime
= localtime (&curtime
);
19 /* Print out the date and time in the standard format. */
20 fputs (asctime (loctime
), stdout
);
23 /* Print it out in a nice format. */
24 strftime (buffer
, SIZE
, "Today is %A, %B %d.\n", loctime
);
25 fputs (buffer
, stdout
);
26 strftime (buffer
, SIZE
, "The time is %I:%M %p.\n", loctime
);
27 fputs (buffer
, stdout
);