LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 03-24-2006, 06: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, 07:52 PM   #2
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 446

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP 4 hour time difference... Santinelli Linux - Enterprise 1 09-08-2005 11:04 AM
am/pm verses 24 hour time CouchMaster Suse/Novell 5 05-05-2005 01:02 PM
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


All times are GMT -5. The time now is 02:56 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration