LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash,how to tell `date` to speak english, but do not change LC_TIME (https://www.linuxquestions.org/questions/programming-9/bash-how-to-tell-%60date%60-to-speak-english-but-do-not-change-lc_time-4175433475/)

nuser 10-22-2012 06:55 AM

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

colucix 10-22-2012 07:37 AM

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.

nuser 10-22-2012 07:54 AM

Quote:

Originally Posted by colucix (Post 4812119)
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!

Habitual 10-22-2012 10:15 AM

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?

markush 10-23-2012 11:44 AM

Quote:

Originally Posted by colucix (Post 4812119)
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


All times are GMT -5. The time now is 01:20 PM.