LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2012, 06:55 AM   #1
nuser
LQ Newbie
 
Registered: Jun 2012
Distribution: open suse 12.2
Posts: 17

Rep: Reputation: Disabled
Bash,how to tell `date` to speak english, but do not change LC_TIME


How to tell `date` to speak enlish, but do not change LC_TIME
I need `date` output in English ,my is пн окт 22 14:54:50 EEST 2012
 
Old 10-22-2012, 07:37 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You can set LC_TIME inline with the date command:
Code:
LC_TIME=en_US date
in this way it will only affect the date command, leaving the current shell environment untouched.
 
2 members found this post helpful.
Old 10-22-2012, 07:54 AM   #3
nuser
LQ Newbie
 
Registered: Jun 2012
Distribution: open suse 12.2
Posts: 17

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colucix View Post
You can set LC_TIME inline with the date command:
Code:
LC_TIME=en_US date
in this way it will only affect the date command, leaving the current shell environment untouched.
Thank you!
 
Old 10-22-2012, 10:15 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
TZ=PST8PDT date 
Mon Oct 22 08:13:32 PDT 2012
date
Mon Oct 22 11:13:36 EDT 2012
satisfies the request, no?
 
1 members found this post helpful.
Old 10-23-2012, 11:44 AM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by colucix View Post
You can set LC_TIME inline with the date command:
Code:
LC_TIME=en_US date
in this way it will only affect the date command, leaving the current shell environment untouched.
This is a very helpful post, thanks very much to colucix. I've always wondered how I can xmobar tell to show german date-format. Here my solution (a line in my .xmobarrc):
Code:
-- .xmobarrc
Run Date "%a %d. %B %A %H:%M Uhr" "LC_TIME=de_DE date" 10
Markus
 
  


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
LXer: How to change Thunderbird's date format in Date column LXer Syndicated Linux News 0 07-18-2012 02:11 AM
Date comparison with 'string date having slashes and time zone' in Bash only TariqYousaf Programming 2 10-08-2009 07:37 AM
linux speak and code > english lxquestions000019 Linux - Newbie 1 07-03-2009 05:05 PM
LXer: Beginners Linux: "Forget Laymans terms, DO YOU SPEAK ENGLISH?" LXer Syndicated Linux News 0 04-17-2007 05:46 PM
how to change everything to english language ? kuser:) Linux - Newbie 2 09-18-2005 09:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:10 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