102-500 · Question #60
Which of the following tasks can the date command accomplish? (Choose two.)
The correct answer is A. Set the system's date and time. E. Display time in a specific format. A is correct because the date command can both display and set the system's date and time (with root privileges), making "set date but not time" (B) a false restriction - it handles both together or either component. E is correct because date accepts format strings (e.g., date…
Question
Options
- ASet the system's date and time.
- BSet the system's date but not the time.
- CCalculate the time span between two dates.
- DPrint a calendar for a month or a year.
- EDisplay time in a specific format.
How the community answered
(24 responses)- A83% (20)
- B8% (2)
- C4% (1)
- D4% (1)
Explanation
A is correct because the date command can both display and set the system's date and time (with root privileges), making "set date but not time" (B) a false restriction - it handles both together or either component.
E is correct because date accepts format strings (e.g., date "+%Y-%m-%d %H:%M:%S") to display time in virtually any format you specify.
B is wrong because date sets date and time as a unit; there's no artificial restriction to date-only.
C is wrong because date has no built-in span-calculation feature - computing differences between two dates requires scripting arithmetic or separate tools like dateutils.
D is wrong because printing calendars is the job of the cal (or ncal) command, not date.
Memory tip: Think of date as having two jobs - display (with custom formats) and set (date + time). If a task sounds like it belongs to a calendar app (cal) or a calculator, it's not date.
Topics
Community Discussion
No community discussion yet for this question.