Need some help in checking date thing.

I

infinus

Hi folks,

i have a problem,

i want to allow user to download data once after he has got a key.
once user got a key.
it will expire in a week.

now, i need to check whether key is expired
if yes.
i have to ask him to buy new key. which will be valid for 7 days.


how to use date function in this....

need urgent help...
 
E

Eric Sosman

infinus said:
Hi folks,

i have a problem,

i want to allow user to download data once after he has got a key.
once user got a key.
it will expire in a week.

now, i need to check whether key is expired
if yes.
i have to ask him to buy new key. which will be valid for 7 days.


how to use date function in this....

When you issue a key, use the time() function to learn
the current time and incorporate that as part of the key.
When someone uses the key to attempt access, extract the
saved issue time from the key, call time() again to learn
the time of the access attempt, and use difftime() to find
the number of seconds between the two moments. The key is
still valid if the difference is less than 7*24*60*60 seconds,
or has expired if the difference is greater.

My fee for providing this data is three percent of the
price of each key you sell. Payment for each month's take
is due on the fifteenth of the following month, with 1%
interest per day (compounded) for late remittances. Should
a payment become delinquent by sixty or more days, I reserve
the right to have my friend Stavro "The Pitchfork" Grzdjelv
audit your books -- with prejudice -- as soon as he's released.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top