Home : General : Perl Programming :

General: Perl Programming: Re: [meenu] Need help convert timestamp to date: Edit Log

Here is the list of edits for this post
Re: [meenu] Need help convert timestamp to date
Hello Meenu, try :

#!/usr/bin/perl

# example given
# lastLoginTime = 127185822896362317
# 1/14/2004 2:31:29 PM

$win32Time ="127185822896362317";

$high = substr($win32Time,0,9);
$low = substr($win32Time,9,2);

$a_Temp = ((($high - 116444736) *100) + $low + 10800);

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($a_Temp);

$year += 1900;
$mon += 1;

print "$mon/$mday/$year at $hour:$min:$sec \n";

# does this work ? with other lastLoginTime values ?

thanks cornball (-:

Last edited by:

cornball: Mar 25, 2004, 9:10 PM

Edit Log: