Is there a way to convert from/to RFC 822 dates without using the DateTime module?
I'm working on a program to process podcast RSS feeds and I'm running into a minor problem with the pubDate element. I want to determine whether or not to download the podcast based on the date that it was published, but all of the feeds publish in different time zones. So, I need to convert the pubDate (formatted per RFC 822) to my local time in order to use it.
One solution involves the DateTime module, but I'd like to avoid additional dependencies, if possible.
Another solution is to just use the shell's date command, which recognizes the RFC 822 date format and can convert it to another format for me.
For example:
This is the solution I'll use if there isn't another option, but it seems like there must be something built into Perl that I'm missing. Thank you.use POSIX 'strftime'; my $pubdate = 'Thu, 11 Jun 2009 11:50:00 PDT'; my $pubdate_here = strftime("%D %T", localtime(`date +"%s" --date="$pu +bdate"`));
-- -- GhodmodeBlessed is he who has found his work; let him ask no other blessedness.
In reply to RFC 822 date manipulation without DateTime module? by GhodMode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |