Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: RFC 822 date manipulation without DateTime module?by GhodMode (Pilgrim) |
on Jun 12, 2009 at 12:29 UTC ( [id://770933]=note: print w/replies, xml ) | Need Help?? |
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. -- -- GhodmodeBlessed is he who has found his work; let him ask no other blessedness. -- Thomas Carlyle
In Section
Seekers of Perl Wisdom
|
|