List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:June 4 2000 2:57pm
Subject:Question about subtracting from timestamp
View as plain text  
I have a timeclock program running with Mysql and would like to know if
its possible to do a simple subtraction on the timestamp.

Basically when the admin wants to check time card history of the student
workers I have a drop down menu of all the students and then I would
like to have two choices 1. complete history and 2. how many days from
current day.

1.  With the complete history I can simply grab the timestamp when the
user was created and current date.

2.  WIth how many days back - say 1 week - is there an easy way to
subtract 7 days or 1 week from a current timestamp and I guess the
timestamp would be the current date/time?

So,  Now( ) - 7 days?  and how would that be written out?
Then I need to grab the result of the created timestamp-7 days and
do a between statement show all records from student that fall between
the $now ( ) -7 days  and
Now( )?

Thansk,

Douglas

Thread
Question about subtracting from timestampDouglas Brantz4 Jun
  • Re: Question about subtracting from timestampDouglas Brantz4 Jun
    • RE: Question about subtracting from timestampSander Pilon4 Jun
  • RE: Question about subtracting from timestampSander Pilon4 Jun
  • Re: Question about subtracting from timestampDouglas Brantz4 Jun
  • subtracting from timestampDouglas Brantz4 Jun