Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-24-2006, 06:56 PM   #1
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
24 to 12 hour time conversion command?

is there a command that changes time from 24 hour format to 12 hour format?
Old 03-24-2006, 07:52 PM   #2
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 454

Rep: Reputation: 32
In the GUI, right-click on the clock and choose preferences.

On the command line
pogson@Beast:~$ date
Fri Mar 24 19:46:53 CST 2006
pogson@Beast:~$ date +%I
pogson@Beast:~$ date +%H

See man date for details of formatting the time string.
When you have it the way you want it, you can define your own command to display time with alias
alias T=date +%I

alias T="date +%H"
You can put the alias command in your .bashrc file in your home directory so the command you defined will be there at the next login.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
am/pm verses 24 hour time CouchMaster SUSE / openSUSE 8 05-20-2015 10:13 AM
FTP 4 hour time difference... Santinelli Linux - Enterprise 1 09-08-2005 11:04 AM
linux time changes 1 hour -- after reboot mrconover Linux - Software 4 10-07-2004 05:13 PM
Time updated by ntp is 1 hour behind jon1591 Linux - Newbie 2 06-21-2004 02:34 PM
Why is the time always an hour behind? aaa LQ Suggestions & Feedback 6 07-23-2003 12:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration