<div dir="ltr"><div>I didn't know this would end up so complicated :)</div><div><br></div><div>Thanks Rob and I just tried it. It works for my use case and now understands the "stat" output for the date format.</div><div><br></div><div>Frank</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 28, 2021 at 4:07 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/28/21 4:06 AM, Rob Landley wrote:<br>
> On 5/26/21 11:17 AM, Frank Liu wrote:<br>
>> A bit background, the TZ string actually came from the "stat":<br>
> <br>
> I'm fine with it, I've seen that in mbox files and so on too.<br>
> <br>
> The question I have is how I feed the information to the libc functions. Since<br>
> setting TZ to "+1234" didn't work (nor did setting it to just 1234), I'm<br>
> guessing I need to parse the data and assign it to "timezone" myself? Except<br>
> doing so appears to be ignored in glibc. From a quick glace at the musl source<br>
> it looks like it might work there?<br>
<br>
Ok, I need to feed libc TZ="UTC+xxxx" with no space, and THEN it understands the<br>
file format in the man page.<br>
<br>
Except if the date is "1980-01-02" and I peel off the trailing -02 as a timezone<br>
adjustment, it breaks. So I need to parse a comprehensible date format and THEN<br>
peel off time zone adjustments if there's anything left over. Which means this<br>
can't be in the parse_date() wrapper along with the TZ="" logic, this needs to<br>
go into xparsedate(), and...<br>
<br>
It's already in there. Sigh. Except for the part where it doesn't actually<br>
work... because it doesn't understand the space. And it also can't handle +01 or<br>
"... + 01 : 01 " which is 5 spaces that the gnu/dammit one can so SOMEBODY out<br>
there is likely to have.<br>
<br>
Did you know that trailing + or - by themselves are ignored? They don't count as<br>
+0, the timezone is unchanged by them. Because GNU, of course.<br>
<br>
Alright, I checked something in. Try now?<br>
<br>
Rob<br>
</blockquote></div>