Unix and Linux Discussions Tagged with macos |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
14,147 |
Programming |
|
|
|
3 |
13,001 |
OS X (Apple) |
|
|
|
6 |
39,972 |
OS X (Apple) |
|
|
|
0 |
16,977 |
Programming |
|
|
|
0 |
18,300 |
OS X (Apple) |
|
|
|
3 |
10,735 |
Programming |
|
|
|
3 |
9,461 |
OS X (Apple) |
|
|
|
6 |
16,957 |
Windows & DOS: Issues & Discussions |
|
|
|
8 |
32,966 |
OS X (Apple) |
|
|
|
10 |
24,110 |
Programming |
|
|
|
9 |
31,913 |
Programming |
|
|
|
18 |
32,416 |
Programming |
|
|
|
0 |
24,881 |
OS X (Apple) |
|
|
|
5 |
15,204 |
OS X (Apple) |
|
|
|
5 |
4,612 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
11,047 |
OS X (Apple) |
|
|
|
0 |
37,818 |
OS X (Apple) |
|
|
|
30 |
55,796 |
OS X (Apple) |
|
|
|
4 |
2,186 |
Shell Programming and Scripting |
|
|
|
6 |
8,383 |
OS X (Apple) |
|
|
|
14 |
10,201 |
OS X (Apple) |
|
|
|
0 |
1,750 |
Software Releases - RSS News |
|
|
|
0 |
1,381 |
Software Releases - RSS News |
|
|
|
0 |
1,480 |
Software Releases - RSS News |
|
|
|
0 |
1,436 |
Software Releases - RSS News |
|
|
|
7 |
11,103 |
UNIX for Dummies Questions & Answers |
Epoch(3) User Contributed Perl Documentation Epoch(3)
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
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>.
BUGS
o 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.
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.
perl v5.18.2 2003-05-21 Epoch(3)