If you want to display the date and time on your Mac Terminal, you can make use of the date command.
Example:% date
Thu Sep 6 11:56:15 EST 2023
If you wish to change the date and time of your Mac device, you can make use of the same date command with elevated privileges as follows,
Change Date and Time
% sudo date 090712002023.30
Password:
Thu Sep 7 12:00:30 EST 2023
The date/time format string: mmddHHMMyyyy.ss
Format | Description | Valid Values |
---|---|---|
mm | Month (01-12) | 01 to 12 |
dd | Day (01-31) | 01 to 31 |
HH | Hour (00-23) | 00 to 23 |
MM | Minute (00-59) | 00 to 59 |
yyyy | Year (e.g., 2021) | Any valid year |
ss | Second (00-61) | 00 to 61 (allowing for leap seconds) |
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to MacOS,
- How to show line numbers in Nano on Mac
- How to install Jupyter Notebook on macOS Sonoma
- How to Disable Remote Management using Mac Terminal
- Test internet speed using macOS Terminal command
- Docker Desktop needs privileged access macOS
- Google Search Hot Trends Screensaver for Mac OS X
- How to do calculations in Mac Terminal
- How to make TextEdit the default text Editor on Mac
- How to Show Full Website Address on Safari for Mac (Ventura/Sonoma)
- The Zsh Shell - Mac Tutorial
- Opening mac Terminal
- How to change the name of your Mac running on macOS Ventura 13
- How to find the Battery Cycle Count on macOS Ventura
- How to set an emoji as Zsh terminal prompt in macOS
- How to access Trash Folder using Mac Terminal Command
- macOS Ventura XCode Command Line Tools Installation
- Hide Bluetooth icon on Mac Menu Bar macOS Ventura 13
- How to run .sh file in Mac Terminal
- Terminal Command to get the list of available shells in macOS
- How to see Storage Information on macOS Ventura
- How to Go To /usr/local/bin on Mac Terminal?
- How to do screen recording on Mac
- How to Find File and Directory Size in Mac Terminal
- Open .bash_profile File in TextEdit using Terminal
- Remove Now Playing icon from macOS Big Sur Menu Bar
More Posts:
- VS Code Remove Unused Imports Keyboard Shortcut - HowTos
- What is exit(0), exit(1) ... exit(8) codes in Python Programming - Python
- Error : Invalid key hash.The key hash does not match any stored key hashes - Android
- osascript: Docker Desktop wants to create symlinks [macOS] - Docker
- Setting up JUnit 5 dependency with Maven Example - Java
- What is Bootstrap Jumbotron and how to use it - Bootstrap
- How to Exit Node Prompt from Mac Terminal - MacOS
- Code2care.org: A Decade of Serving the Tech Community - News