LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-24-2006, 07:56 PM   #1
true_atlantis
Member
 
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, 08:52 PM   #2
RobertP
Member
 
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
07
pogson@Beast:~$ date +%H
19

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"
T
19
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.
 
  


Reply


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 11:13 AM
FTP 4 hour time difference... Santinelli Linux - Enterprise 1 09-08-2005 12:04 PM
linux time changes 1 hour -- after reboot mrconover Linux - Software 4 10-07-2004 06:13 PM
Time updated by ntp is 1 hour behind jon1591 Linux - Newbie 2 06-21-2004 03:34 PM
Why is the time always an hour behind? aaa LQ Suggestions & Feedback 6 07-23-2003 01:34 PM


All times are GMT -5. The time now is 08:35 PM.

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