I am trying to create a Date header for an email.
The format is as follows:
DayOfWeek, Day ShortMonth Year Hours:Minutes:Seconds Offset (TimeZone)
So an example would be:
Fri, 19 Mar 2010 11:44:09 -0700 (PDT)
Its the TimeZone part (PDT in the example) that I’m trying to get. I realize that this will be different across systems, but I’d like a solution for all of them.
Thanks!
You are looking for
%Zinstrftime().For example:
And it’s C89, AFAIR (which means it’s very portable).
Snippet from the C99 standard:
Sadly, as we noticed not every system gives reasonable values for it…