l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2004 Jun 23 15:14

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Easiest way to calculate date in 100 ns increments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Easiest way to calculate date in 100 ns increments?



On Wed 23 Jun 04,  2:08 PM, Bill Kendrick <nbs@sonic.net> said:
> On Wed, Jun 23, 2004 at 01:54:26PM -0700, emily wrote:
> > 
> > I need to be able to convert dates from a human readable format 
> > (something like YYYYMMDD) to a number in hundred nanosecond intervals 
> > starting from Jan 1 1601 as 0.
> 
> In C there's the ctime function and friends.  Kind of a pain to use.

i don't think ctime() will get her where she wants to go easily.

> I'm betting PHP or Perl has something handy just for this.
> (I know "time()" in PHP gives the current time in seconds since Unix epoch,
> which was 1970, perhaps it's flexible about epoch and/or using an arbitrary
> date/time)
 
sounds like a job for perl.  if perl can't do it, i'll eat my shorts.

a quick google search yields perl-Date-Calc:

   This package consists of a C library (usable standalone), and a Perl
   module to access this library from Perl.

   The library provides all sorts of date calculations based on the
   Gregorian calendar (the one used in all western countries today),
   thereby complying with all relevant norms and standards: ISO/R
   2015-1971, DIN 1355 and, to some extent, ISO 8601 (where applicable).

i've never used this package, but it at least sounds hopeful.

google also reports Date::Pcalc, which claims to be very similar to
perl-Date-Calc, but written completely in perl (he claims that he
wrote perl-Date-Calc because an ISP prevented him from compiling C code
on a server, so he couldn't use perl-Date-Calc.

looks like there are a few perl date calculation packages.

i'm sure python also has ways of doing this (but i don't know a lick of
python).

hth,
pete

-- 
In theory, theory and practise are the same.  In practise, they aren't.
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!