JSCalendar-Duration
    
    
  
  
  
view release on metacpan or search on metacpan
lib/JSCalendar/Duration.pm view on Meta::CPAN
  # 104403.1
  my $seconds = duration_to_seconds("P1DT5H3.1S");
  # P1D
  my $duration = seconds_to_duration('86400');
=head1 DESCRIPTION
This module converts between a duration of time as specified by seconds and
a JSCalendar duration (L<https://tools.ietf.org/html/draft-ietf-calext-jscalendar-00#section-3.2.3>).
=head1 PERL VERSION
This module should work on any version of perl still receiving updates from
the Perl 5 Porters.  This means it should work on any version of perl released
in the last two to three years.  (That is, if the most recently released
version is v5.40, then this module should work on both v5.40 and v5.38.)
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not be increased.  The version may be increased
lib/JSCalendar/Duration.pm view on Meta::CPAN
=head2 duration_to_seconds
  my $seconds = duration_to_seconds("P1DT4H");
Converts a JSCalendar duration to seconds.
=head1 SEE ALSO
=over 4
=item L<https://tools.ietf.org/html/draft-ietf-calext-jscalendar-00#section-3.2.3>
The JSCalendar duration spec.
=back
=head1 AUTHOR
Matthew Horsfall <wolfsage@gmail.com>
=head1 CONTRIBUTORS
lib/JSCalendar/Duration.pm view on Meta::CPAN
#pod
#pod   # 104403.1
#pod   my $seconds = duration_to_seconds("P1DT5H3.1S");
#pod
#pod   # P1D
#pod   my $duration = seconds_to_duration('86400');
#pod
#pod =head1 DESCRIPTION
#pod
#pod This module converts between a duration of time as specified by seconds and
#pod a JSCalendar duration (L<https://tools.ietf.org/html/draft-ietf-calext-jscalendar-00#section-3.2.3>).
#pod
#pod =head1 EXPORTS
#pod
#pod =head2 seconds_to_duration
#pod
#pod   my $duration = seconds_to_duration("86401.2");
#pod
#pod Converts seconds to a JSCalendar duration representation.
#pod
#pod =head2 duration_to_seconds
#pod
#pod   my $seconds = duration_to_seconds("P1DT4H");
#pod
#pod Converts a JSCalendar duration to seconds.
#pod
#pod =head1 SEE ALSO
#pod
#pod =over 4
#pod
#pod =item L<https://tools.ietf.org/html/draft-ietf-calext-jscalendar-00#section-3.2.3>
#pod
#pod The JSCalendar duration spec.
#pod
#pod =back
#pod
#pod =cut
( run in 0.716 second using v1.01-cache-2.11-cpan-5dc5da66d9d )