Query: time::epoch
OS: osx
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Epoch(3) User Contributed Perl Documentation Epoch(3)NAMETime::Epoch - Convert between Perl epoch and other epochsSYNOPSIS#!/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;DESCRIPTIONExports 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 o macos Takes additional optional parameter of time zone differential. If time zone differential not supplied, we guess by getting the different between "localtime" and "gmtime" with <Time::Local::timelocal>.BUGSo Hm. With the above test, "scalar localtime $perlsec" under my Linux box and "scalar localtime $epochsec" under my Mac OS box are off by one second from each other. Maybe a leap second thing? Odd.AUTHORChris 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 ALSOperl(1), perlport(1), Time::Local. perl v5.16.2 2003-05-21 Epoch(3)
Related Man Pages |
---|
time::local5.18(3pm) - mojave |
time::epoch(3) - osx |
time::local(3pm) - osx |
datetime::format::epoch::macos(3pm) - debian |
test::mocktime(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
Network standalone Unix box |
Looking to install Unix on my Mac |
using variables in perl not working |
Converting Epoch time |
Macos is the UNIX? |