The attached class is a date utility that I created a long time ago.  

It parses out SQL dates, does differences, and specific to your needs,
you can use dateAdjust() to move a unix timestamp by a number of
seconds, minutes, hours, days, months, quarters, years or centuries.

You should be able to either employ this class, or simply look through
the code to find the answers to most of your date woes.  The only thing
this class doesn't do, is account for leap years, when working with
quantities that span multiple months. (never got around to this yet,
suppose I will need to before 2004!)

Attached is also a short readme to explain what the functions are and
what they do (the code itself is also well commented).

Best wishes!

Michael "phpzen"

-----Original Message-----
From: andy [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 06, 2002 4:50 AM
Subject: [PHP] unix timestamp

Hi everybody,

I am trying to create a unix timestamp which dates back a certain amount
of days. Lets say I would like to have a unix timestamp from 7 days ago.

what I tryed is just to subtract values since this are counted s since
the start of the unix epoche, but this does not work in cases like the
switch of months. Has anybody an idea how to do that?

Thanx, Andy

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to