I can't use gmtime because it can't use a string like the date specification in an RSS feed. It only takes the number of seconds since the epoch as returned by time (or the shell's date +%s).
The only real problem is with the text representation of the time-zone. Looking through the time zones used in my feeds, I see that they're using either an offset of UTC, or a three-character representation of the time zone. These are mentioned in RFC 822, but it also says that "time zone may be indicated in several ways".
The notes for the POSIX strftime function say that the timezone format specifier is notoriously unportable because the timezones are non-standard. That's probably a good reason why it's not built into the core of the language. The (GNU/Linux) shell's date program recognizes every one, though, whether it uses the offset or the abbreviation.
--
-- Ghodmode
Blessed is he who has found his work; let him ask no other blessedness.
-- Thomas Carlyle
|