Re: INSTALLTIME:date format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
To: Joe Wulf <joe_wulf@xxxxxxxxx>
Cc: Greg Swift <gregswift@xxxxxxxxx>
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@xxxxxxxxx> 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@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list



_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux