INSTALLTIME:date format

Joe Wulf joe_wulf at yahoo.com
Fri Apr 6 03:57:38 UTC 2012


Jeff,

Thank you for the insight and direction.  I'll go explore the LC_TIME issue.  I agree that is the right direction, from what you've said, and the 
little I've read so far.

My process is a casual one.  Once in a while, I'll kick off some 
scripts.   A part of that queries the RPM database for what is installed and provides a structured formatted list back.  All the other data I 
can chop up as I need to.  When that date format comes back different 
ways, it is challenging to process consistently, since the returned data seems to vary so.  What I think I need is a way to prefix my rpm query 
with a command that preserves LC_TIME (or important aspects of it), set 
it temporarily for the duration of that shell script instance to what I want and then puts LC_TIME back (if necessary).  I'm not looking to change the whole 
system around, just to support my occasional need.

I'm going to start looking for a good understanding of locale and specifically the parts and pieces of LC_TIME.

Thank you.

R,-Joe

P.S. resent to the list (I apologize for the duplicate).


>________________________________
> From: Jeffrey Johnson <n3npq at me.com>
>To: Joe Wulf <joe_wulf at yahoo.com> 
>Cc: Greg Swift <gregswift at gmail.com> 
>Sent: Thursday, April 5, 2012 8:32 PM
>Subject: Re: INSTALLTIME:date format
> 
>
>
>
>On Apr 5, 2012, at 8:28 PM, Greg Swift wrote:
>
>Try prefixing the command with LANG=c to see if that is causing the discrepancy. 
>
>Right idea but wrong envvar (is my guess).
>
>
>strftime(3) is used to format dates (in a per-locale fashion).
>
>
>And "man 3 strftime" identifies LC_TIME as what you
>want to change.
>
>
>I don't know what to change LC_TIME to, just that RPM uses strftime(3).
>
>
>hth
>
>
>73 de Jeff
>
>
>On Apr 5, 2012 7:05 PM, "Joe Wulf" <joe_wulf at yahoo.com> wrote:
>>
>>How does one refine or specify the format for the date returned by:   "%{INSTALLTIME:date}"?
>>>
>>>On some systems I get the first response (preferred) and for unknown reasons I get the second on other systems:
>>>-   "Fri 10 Jun 2011 02:03:18 PM GMT"
>>>-   "Fri 10 June 02:03:18 2011"
>>>
>>>
>>>Is there some other, external (maybe posix thing) that affects this?
>>>
>>>Thank you.
>>>
>>>_______________________________________________
>>>Rpm-list mailing list
>>>Rpm-list at lists.rpm.org
>>>http://lists.rpm.org/mailman/listinfo/rpm-list
>>>
>>>
_______________________________________________
>>Rpm-list mailing list
>>Rpm-list at lists.rpm.org
>>http://lists.rpm.org/mailman/listinfo/rpm-list
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20120405/09797c69/attachment.html>


More information about the Rpm-list mailing list