How Do I Change the Date Format in Linux?
Contents

To format date in YYYY-MM-DD format, use the command date +%F or printf “%(%F)Tn” $EPOCHSECONDS . The %F option is an alias for %Y-%m-%d . This format is the ISO 8601 format.

What is the command to change date in Linux?

Set Time, Date Timezone in Linux from Command Line or Gnome | Use ntp

  1. Set date from the command line date +%Y%m%d -s “20120418”
  2. Set time from the command line date +%T -s “11:14:00”
  3. Set time and date from the command line date -s “19 APR 2012 11:14:00”
  4. Linux check date from command line date. …
  5. Set hardware clock.

How do I change the date format in bash?

Bash Date Format MM-YYYY

To format date in MM-YYYY format, use the command date +%m-%Y .

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest