nerdexam
LPI

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…

Administrative Tasks

Question

Which of the following tasks can the date command accomplish? (Choose two.)

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)
  • A
    83% (20)
  • B
    8% (2)
  • C
    4% (1)
  • D
    4% (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

#date command#system time management#time formatting

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice