PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Year 2000 problems??
Date: Jan 29 1998 4:56PM

Charles Taylor wrote:
> 
> Two dumb questions about time;
>      1)Will the script below work in 2000? till.....

Yes - till 2038 (unless the time_t value is changed from a signed
32 bit value to a 64 bit value before then)

>      2)This runs on NT, can a millisecond value be extracted?

No - time() returns a value in seconds.

However, depending on what you are doing you might have better luck
with the stat()/lstat() calls.


> 
> # Calculate the file modification date
>      ($a,$b,$c,$da,$mo,$yr,$x,$y,$z) = localtime((time)-($age*86400));
>      $m = ($mo + 1);
>      $m = sprintf("%02d",$m);
>      $da = sprintf("%02d",$da);
>      $c = sprintf("%02d",$c);
>      $b = sprintf("%02d",$b);
>      $a = sprintf("%02d",$a);
>      $yr=(1900 + $yr);
>      $ACTIVITYdate = "$yr$m$da.$c:$b:$a";

Michael
-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler