LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-19-2010, 12:26 AM   #1
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Rep: Reputation: 1
how to set linux system time in 12/24 hr?


Hi,

When I use the `date' command on RHEL5, I can get the time shown in 24 hr format. I wonder if the time can be shown in 12 hr format. But I don't want to use the `date +FORMAT' to do that, neither `alias date='date +FORMAT''. I just want a simple `date' to show time in 12hr format.

Is there any configuration file about the 12/24 hr format?

Is the format related to the value of the environment variable 'TIMEFORMAT'? I can't find its default value by 'set | grep -i timeformat'.

How can I know what the current format is? I mean, when I use `date', I can get "Sun Sep 19 13:22:50 CST 2010", which seems like 24hr format; but when I use `hwclock', I can get "Sun 19 Sep 2010 01:23:05 PM CST -0.174299 seconds", which seems like 12hr format.

Thank you very much!
 
Old 09-19-2010, 01:34 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
is this a standard RHEL 5.5 headless server ?
or a desktop with Gnome or KDE3 installed ?
 
Old 09-19-2010, 01:50 AM   #3
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
It has a desktop installed. But I only want to use the CLI because I need to write scripts for this.
 
  


Reply



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
how to set and sync system time with time server?? servnov Linux - Newbie 6 12-03-2013 07:55 PM
Not able to set system time using script. muthu@sanatdata.net Linux - Server 2 04-25-2008 03:46 PM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM
set system time xushi Slackware 3 03-31-2005 08:56 AM
how set system time by command prompt? yenonn Linux - Newbie 9 08-25-2003 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:07 AM.

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
Open Source Consulting | Domain Registration