How do I only change the system date, not time?

Solution Verified - Updated -

Issue

When date command is executed with -s option to change the system date, the time is also changed to 00:00:00. How do I only change the system date, not time?

# date
Mon Jun 19 13:31:09 KST 2023

# date -s "2023-06-26"
Mon Jun 26 00:00:00 KST 2023

Environment

  • Red Hat Enterprise Linux 6, 7, 8, and 9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content