{"thread":{"id":"916","subject":"[PATCH] cg-Xlib: make showdate show timezone","startedAt":"2005-06-12T11:40:57Z","lastAt":"2005-06-12T17:37:06Z","messageCount":3,"participants":["Dan Holmsand","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4892","messageId":"42AC1F49.9010808@gmail.com","threadId":"916","inReplyTo":null,"subject":"[PATCH] cg-Xlib: make showdate show timezone","fromName":"Dan Holmsand","fromEmail":"holmsand@gmail.com","sentAt":"2005-06-12T11:40:57Z","receivedAt":"2005-06-12T11:40:57Z","isPatch":true,"sender":{"key":"holmsand@gmail.com","avatar":"https://gravatar.com/avatar/5c722084bafd85e754a02efad01fe69107eb6f393253c49232c5c9f7faa974df?d=mp&s=160"},"body":"This makes timezones show up again in showdate's default\nformat. Hopefully, this also makes showdate a little more\nportable.\n\nIt also speeds things up a little, by avoiding an extra fork.\n\nSigned-off-by: Dan Holmsand <holmsand@gmail.com>\n---\n\n\n cg-Xlib |    8 +++-----\n 1 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -68,14 +68,12 @@ showdate () {\n \t# bash doesn't like leading zeros\n \t[ \"${tzhours:1:1}\" = 0 ] && tzhours=${2:0:1}${2:2:1}\n \tsecs=$(($secs + $tzhours * 3600 + $tzmins * 60))\n+\t[ \"$format\" ] || format=\"+%a, %d %b %Y %H:%M:%S $2\"\n \tif [ \"$has_gnudate\" ]; then\n-\t\t[ \"$format\" ] || format=-R\n-\t\tpdate=$(date -ud \"1970-01-01 UTC + $secs sec\" \"$format\")\n+\t\tLANG=C date -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n \telse\n-\t\t[ \"$format\" ] || format=--\n-\t\tpdate=$(date -u -r $secs \"$format\")\n+\t\tLANG=C date -u -r $secs \"$format\"\n \tfi\n-\techo \"${pdate/+0000/$tz}\"\n }\n \n # Usage: tree_timewarp [--no-head-update] DIRECTION_STR ROLLBACK_BOOL BASE BRANCH\n"},{"id":"4893","messageId":"20050612115259.GD6620@pasky.ji.cz","threadId":"916","inReplyTo":"42AC1F49.9010808@gmail.com","subject":"Re: [PATCH] cg-Xlib: make showdate show timezone","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-12T11:52:59Z","receivedAt":"2005-06-12T11:52:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Jun 12, 2005 at 01:40:57PM CEST, I got a letter\nwhere Dan Holmsand <holmsand@gmail.com> told me that...\n> This makes timezones show up again in showdate's default\n> format. Hopefully, this also makes showdate a little more\n> portable.\n> \n> It also speeds things up a little, by avoiding an extra fork.\n> \n> Signed-off-by: Dan Holmsand <holmsand@gmail.com>\n\nThanks, applied. But what's the point of calling date with LANG=C? If\nthe user wants his locale to get used, why prevent him?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"},{"id":"4903","messageId":"42AC72C2.8000807@gmail.com","threadId":"916","inReplyTo":"20050612115259.GD6620@pasky.ji.cz","subject":"Re: [PATCH] cg-Xlib: make showdate show timezone","fromName":"Dan Holmsand","fromEmail":"holmsand@gmail.com","sentAt":"2005-06-12T17:37:06Z","receivedAt":"2005-06-12T17:37:06Z","isPatch":true,"sender":{"key":"holmsand@gmail.com","avatar":"https://gravatar.com/avatar/5c722084bafd85e754a02efad01fe69107eb6f393253c49232c5c9f7faa974df?d=mp&s=160"},"body":"Petr Baudis wrote:\n> Thanks, applied. But what's the point of calling date with LANG=C? If\n> the user wants his locale to get used, why prevent him?\n\nBecause otherwise, you won't get an RFC-2822 date (which is what you \nexplicitly wanted a couple of days ago, and what we had before).\n\nAlso, it would look pretty awkward to have parts of the output localized \n  (the date string), and all other parts not (\"author\", \"date\", whatnot).\n\n/dan\n"}]}