The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SVN::Friendly::Dates - convert subversion times to Perl time

SYNOPSIS

  # ---------------------------------------------------------------
  # $iAprTime    Apache runtime timestamp, number of microseconds
  #              since 00:00:00 UTC, January 1, 1970
  #
  # $iPrecision  may be any one of the following constants
  #              SVN::Friendly::Dates->DAY
  #              SVN::Friendly::Dates->MINUTE
  #              SVN::Friendly::Dates->SECOND
  #              SVN::Friendly::Dates->USEC
  #
  # $sISOTime     ISO 8601 formatted timestamp provided by subversion
  #              (some functions provide the string rather than
  #               microseconds since epoch time).
  # ---------------------------------------------------------------

  use SVN::Friendly::Dates /.*/;  #import all


  # --------------------------------------------------
  # decompresses ISO time, replaces Z with UTC, e.g.
  #
  # 1970-01-01T00:00:00.000000
  #   DAY    => 1970-01-01
  #   MINUTE => 1970-01-01 00:00 UTC
  #   SECOND => 1970-01-01 00:00:00 UTC
  #   USEC   => 1970-01-01 00:00:00.000000 UTC
  # --------------------------------------------------

  $sTimestamp    = getTimestampFromISO8601($sISOTime, $iPrecision);

  $sTimestamp    = getTimestamp($iAprTime, $iPrecision);

  # --------------------------------------------------
  # local/utc seconds since the epoch in various units
  # --------------------------------------------------

  $iSeconds      = getUtcPerlTime($iAprTime);

  $iNanoseconds  = getUtcNanoTime($iAprTime);

  $iSeconds      = getLocalPerlTime($iAprTime);

  $iMicroseconds = getLocalUsecTime($iAprTime);

  $iNanoseconds  = getLocalNanoTime($iAprTime);

DESCRIPTION

This class defines tools for converting the timestamps used by subversion into Perl time. Subversion uses the apache runtime library and its timestamps have a different unit (microseconds) than Perl time which is calculated in non-leap seconds past 00:00:00 UTC, January 1, 1970.

VERSION COMPATIBILITY

See SVN::Friendly.

CAVEATS

None to date.

KNOWN BUGS

None to date.

TO DO/ROADMAP

See SVN::Friendly

VOLUNTEERS

If anyone would like to be involved in testing or expanding the user friendly interface, please contact the maintainer.

Feedback on the documentation, bugs, usability, or additional features desired is welcome. Time and person-power permitting the most commonly requested features will be implemented.

SEE ALSO

See SVN::Friendly

AUTHOR

Elizabeth Grace Frank-Backman

COPYRIGHT

Copyright (c) 2008-2011 Elizabeth Grace Frank-Backman. All rights reserved.

LICENSE

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