XML::Generator::RSS10::ev - Support for the Event (ev) RSS 1.0 module


    use XML::Generator::RSS10;
         use DateTime;
    my $rss = XML::Generator::RSS10->new( Handler => $sax_handler, modules => [ qw(ev) ] );
                title => 'Perl Poetry Recitals',
                link  => '',
                description => 'Some lovely Perl poetry, read loudly by Brian Blessed',
                ev => {
                   startdate => { year   => 2006,
                                  month  => 05,
                                  day    => 01,
                                  hour   => 19,
                                  minute => 00,
                                  second => 00,
                                  time_zone  => 'local'
                   enddate   => { year   => 2006,
                                  month  => 05,
                                  day    => 01,
                                  hour   => 20,
                                  minute => 00,
                                  second => 00,
                                  time_zone  => 'local',
                   location  => 'Town Hall, Exampleham, UK',
                   organizer => 'Example Organisation,',
                   type      => 'Recital'
                   title => 'Diary of Events',
                   link  => '',
                   description => 'Forthcoming example events'


This module extends Dave Rolsky's XML::Generator::RSS10 to provide support for the Event (ev) RSS 1.0 module.

For full details of the Event module specification, see

Where event data is supplied, the startdate and enddate elements are required. These should be output in W3CDTF date/time format, as defined at To help facilitate this, the module accepts four types of value for either element, which will be formatted to W3CDTF.

Define the date using a hashref

If the module is passed a hashref with date and time values as above, it will create a DateTime object from these and use DateTime::Format::W3CDTF to output in W3CDTF.

If the hashref doesn't contain any time values (hour, minute or second), the output won't either.

Pass a DateTime object directly

The module will use DateTime::Format::W3CDTF to output the date and time in the correct format.

Note: Since DateTime doesn't distinguish between a date with no time component and midnight, the output of this module when passed a DateTime object directly will always include a time.

Pass a scalar value in epoch seconds

Alternatively, a time value may be supplied in epoch seconds. This will be converted internally to a DateTime object, and thence formatted to W3CDTF.

Pass a string already in in W3CDTF

Any other scalar value passed as a startdate or enddate will be assumed to be already in W3CDTF, and will be output verbatim.


Version 0.01: Initial release.


XML::Generator::RSS10, DateTime, DateTime::Format::W3CDTF.


Andrew Green, <>.

Sponsored by Woking Borough Council,


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.