Re: how do I protect/encrypt sensitive data in a database?
| From: | Chris Adams | Date: | Mon, 26 Jun 2000 23:30:08 +0000 |
| Subject: | Re: how do I protect/encrypt sensitive data in a database? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3244@lists.php.net to get a copy of this message | ||
> PHP doesn't have any date functions really that are built in.
Actually, it has a really powerful date system. date()/time()/mktime() are arguably more powerful
than anything MySQL has and considerably faster. Use mktime() to turn a textual date into a Unix
timestamp, which is simply stored as seconds since an epoch:
1 day = 24 * 60 * 60 seconds = 86400
To find the number of days between two dates, just subtract one from the other and divide by 86400:
$DiffInSeconds = (mktime(0,0,0, 10, 1, 2000) - mktime(0,0,0, 06, 1, 2000))
$DiffInDays = $DiffInSeconds / 86400