Chris Nandor > Time-Epoch > Time::Epoch

Download:
Time-Epoch-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Time::Epoch - Convert between Perl epoch and other epochs

SYNOPSIS ^

  #!/usr/bin/perl -wl
  use Time::Epoch;
  my $perlsec  = 966770660;  # Sun Aug 20 07:24:21 2000 -0400 on Mac OS
  my $epochsec = perl2epoch($perlsec, 'macos', '-0400');
  my $perlsec2 = epoch2perl($epochsec, 'macos', '-0400');

  print $perlsec;
  print $perlsec2;
  print $epochsec;
  # correct time on Unix:
  print scalar localtime $perlsec;
  # correct time on Mac OS (-0400):
  print scalar localtime $epochsec;

DESCRIPTION ^

Exports two functions, perl2epoch and epoch2perl. Currently only goes between Perl (Unix) epoch and Mac OS epoch. This is in preparation for an eventual move of Perl to its own universal epoch, so we can get the system epoch of any platform that differs from Perl's.

Epochs

BUGS ^

AUTHOR ^

Chris Nandor <pudge@pobox.com>, http://pudge.net/

Copyright (c) 2000-2003 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl.

SEE ALSO ^

perl(1), perlport(1), Time::Local.

syntax highlighting: