in reply to Using timelocal function
Called as :
#=== Assuming March 31, 2008 from the epoch(?) #=== This script will be running on both Windows and #=== unix machines $days = uniVerseDate(0,0,0,31,2,2008,0,0,0,1,0,1970 ... ... sub uniVerseDate { my ($fS,$fM,$fH,$fD,$fMth,$fY,$sS,$sM,$sH,$sD,$sMth,$sY) = @_; my ($fTot, $sTot, $diff, $secDays) = 0; $fTot = timelocal($fS,$fM,$fH,$fD,$fMth,$fY); $sTot = timelocal($sS,$sM,$sH,$sD,$sMth,$sY); $diff = $fTot - $sTot; $secsDay = 60 * 60 * 24; #=== Add 732 to get days from Jan 1, 1968 to #=== Jan 1, 1970 return (($diff / $secsDay) + 732); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using timelocal function
by kyle (Abbot) on Feb 04, 2008 at 18:11 UTC | |
by rpike (Scribe) on Feb 04, 2008 at 18:30 UTC | |
by Narveson (Chaplain) on Feb 05, 2008 at 07:19 UTC | |
by rpike (Scribe) on Feb 04, 2008 at 18:44 UTC | |
by kyle (Abbot) on Feb 04, 2008 at 19:14 UTC | |
|
Re^2: Using timelocal function
by Narveson (Chaplain) on Feb 04, 2008 at 17:40 UTC |