[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using the command `date +%r` returns incorrect format
From: |
Martin Freebody |
Subject: |
Re: Using the command `date +%r` returns incorrect format |
Date: |
Tue, 02 Aug 2005 15:09:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040906 |
Eric/Andreas,
Solved! Thank you for the quick response(s)
> locale
LANG=en_GB
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_PAPER="en_GB"
LC_NAME="en_GB"
LC_ADDRESS="en_GB"
LC_TELEPHONE="en_GB"
LC_MEASUREMENT="en_GB"
LC_IDENTIFICATION="en_GB"
LC_ALL=
> LC_ALL=C date +%r
02:55:34 PM
> LC_ALL=C; export LC_ALL
> locale
LANG=en_GB
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
> date +%r
03:04:46 PM
Cheers,
Martin
Eric Blake wrote:
According to Martin Freebody on 8/2/2005 2:31 AM:
>BUG: Using the command `date +%r` returns incorrect format
>Version: 3.3.0 (using KDE 3.3.0, SuSE)
>Compiler: gcc version 3.3.4 (pre 3.3.5 20040809)
>OS: Linux (i686) release 2.6.8-24-smp
>Using the command `date +%r` should give me for example "2:39:00 PM" but
>on my machine it returns "02:39:00". [time is set correctly as %R
>returns "14:39"].
What is your locale? And what does `LC_ALL=C date +%r' print? This is a
feature of strftime under locales.
--
Life is short - so eat dessert first!
Eric Blake address@hidden
--
Martin Freebody
Software Engineering Dept.
Catapult Communications
www.catapult.com