FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 10-12-2012, 10:07 PM
Evuraan
 
Default this should be a bug, date +%X

man date says:

%X locale’s time representation (e.g., 23:13:48)

date (GNU coreutils) 7.4 gives:

$ date +%X
03:04:42 PM
^^ ^^^^^------- this

instead it should just be

$ date +%X
15:04:42

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 10-12-2012, 10:57 PM
J
 
Default this should be a bug, date +%X

On Fri, Oct 12, 2012 at 6:07 PM, Evuraan <evuraan@gmail.com> wrote:
> man date says:
>
> %X locale’s time representation (e.g., 23:13:48)
>
> date (GNU coreutils) 7.4 gives:
>
> $ date +%X
> 03:04:42 PM
> ^^ ^^^^^------- this
>
> instead it should just be
>
> $ date +%X
> 15:04:42

No it shouldn't... check your locale. For example, en_US:

% Appropriate time representation (%X)
% "%r"
t_fmt "<U0025><U0072>"
%
% Appropriate AM/PM time representation (%r)
% "%I:%M:%S %p"
t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025> <U0053><U0020>/
<U0025><U0070>"


This tells date that the appropriate time representation for the en_US
locale is exactly what you are seeing.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 10-13-2012, 12:37 AM
C de-Avillez
 
Default this should be a bug, date +%X

On 12/10/12 17:57, J wrote:
> On Fri, Oct 12, 2012 at 6:07 PM, Evuraan <evuraan@gmail.com> wrote:
>> man date says:
>>
>> %X locale’s time representation (e.g., 23:13:48)
>>
>> date (GNU coreutils) 7.4 gives:
>>
>> $ date +%X
>> 03:04:42 PM
>> ^^ ^^^^^------- this
>>
>> instead it should just be
>>
>> $ date +%X
>> 15:04:42
>
> No it shouldn't... check your locale. For example, en_US:
>
> % Appropriate time representation (%X)
> % "%r"
> t_fmt "<U0025><U0072>"
> %
> % Appropriate AM/PM time representation (%r)
> % "%I:%M:%S %p"
> t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025> <U0053><U0020>/
> <U0025><U0070>"
>
>
> This tells date that the appropriate time representation for the en_US
> locale is exactly what you are seeing.
>

Indeed, and expected, coreutils respects locale. A quick check shows:

[cerdea-aws]cerdea@xango3:/build/buildd$ env LC_TIME="en_US.UTF-8"
date +%X



07:35:36 PM
[cerdea-aws]cerdea@xango3:/build/buildd$ env LC_TIME="en_DK.UTF-8"
date +%X



19:35:48
[cerdea-aws]cerdea@xango3:/build/buildd$ date --version
date (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
[cerdea-aws]cerdea@xango3:/build/buildd$

..C..



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 10-15-2012, 02:05 AM
Evuraan
 
Default this should be a bug, date +%X

>> This tells date that the appropriate time representation for the en_US
>> locale is exactly what you are seeing.

ah..! makes sense. Thanks for clarifying.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 01:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org