Unix Timestamp in Filepro
Brian K. White
brian at aljex.com
Fri Oct 7 10:44:51 PDT 2005
----- Original Message -----
From: <ryan at bulldogsoftware.com>
To: "Fairlight" <fairlite at fairlite.com>
Cc: "filePro" <filepro-list at lists.celestial.com>
Sent: Friday, October 07, 2005 12:54 PM
Subject: Re: Unix Timestamp in Filepro
> On Fri, Oct 07, 2005 at 12:16:42PM -0400, Fairlight said:
>
>> *nix timestamps only have a one-second granularity. If you're going
>> more granular than that, it's not the general *nix timestamp as measured
>> by seconds into the epoch. There may be some extended format in some
>> software, but it's not the *nix timestamp standard as generated by
>> time(2).
>
> There is a difference between the "standard" *nix timestamp and what a
> system is capable of at the kernel level. To be sure I'd look at the
> timeval struct (or similar) in time.h. This struct contains the number
> of seconds into the epoch and also (typically) a 32-bit word for
> nanoseconds. You might not find it on a SCO machine but its been on BSD
> for ages.
On a 506 box:
# gdate +%H:%M:%S.%N
13:29:14.163970000
I don't know how it does it though. time.h has a struct tm that only goes to
the second.
%N is claimed to be nanoseconds from 000000000 to 999999999
but running the same command repeatedly many times I have never once seen
anything but 000 for the last 3 digits
# ( n=0 ;while [ $n -lt 50 ] ;do gdate +%N ;n=$((n+1)) ;done ) |less
637342000
657344000
661604000
665185000
667346000
676156000
680036000
683542000
687344000
691971000
695913000
699871000
734445000
738287000
742077000
745833000
747340000
747340000
760227000
765849000
769590000
773272000
776911000
787341000
795409000
811978000
830862000
837288000
887335000
007331000
018165000
027328000
036480000
045857000
058221000
070316000
074094000
077331000
077331000
087279000
091690000
095378000
097325000
106626000
110776000
110776000
117326000
123750000
130187000
133913000
So at least it doesn't look like a totally invented value even if it isn't
quite as precise as advertised.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
More information about the Filepro-list
mailing list