FS#6468 - Localized dates for build/install date

Attached to Project: Pacman
Opened by Aaron Griffin (phrakture) - Wednesday, 21 February 2007, 16:52 GMT
Last edited by Dan McGee (toofishes) - Friday, 13 June 2008, 19:50 GMT
Task Type Feature Request
Category
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture not specified
Severity Low
Priority High
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently pacman stores build and install dates as a textual string. This not only bad for localization, but bad if we ever want to do any calculations / sorting based on dates. These should instead be stored as a numeric time_t. This will allow us to easily output localized time.

The complexity comes up when thinking about how to do this while still maintaining the old scheme... perhaps a check to see if the first char is a number or not and use that to decide which scheme to use?

This is non critical, but a nice-to-have (and fairly simple to fix)
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 13 June 2008, 19:50 GMT
Reason for closing:  Implemented
Additional comments about closing:  Fixed/implemented way back in 3.1
Comment by Dan McGee (toofishes) - Wednesday, 21 February 2007, 16:57 GMT
Is it currently stored in an ISO-recognized format? If so, I'm sure we can not change the storage pattern, but simply change the printing- convert it upon presentation to the user.
Comment by Aaron Griffin (phrakture) - Wednesday, 21 February 2007, 17:03 GMT
no, it's stored as a literal date string in the C locale.

Line 941 of makepkg:
builddate=$(LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y")

Gross.
Comment by Aaron Griffin (phrakture) - Wednesday, 21 February 2007, 17:23 GMT
An ISO format is probably a better idea for date/times and it's easy to parse / localize:
http://www.w3.org/TR/NOTE-datetime

Thanks to Dan for pointing this out.
Comment by Andrew Fyfe (space-m0nkey) - Saturday, 24 March 2007, 08:15 GMT
Or store the build date in .PKGINFO as epoch, then use ctime (converts epoch to local time string) to display the date in pacman.
Comment by Gavin Bisesi (Daenyth) - Friday, 13 June 2008, 19:45 GMT
I like Andrew's suggestion for this.
Comment by Dan McGee (toofishes) - Friday, 13 June 2008, 19:50 GMT

Loading...