Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Calculate Date


Andromeda100

Recommended Posts

Hello,

 

I search for a script which calculates whether a customer is 18 years. At first, I write

 

$calculate = $customer['customers_dob'] - date("d.m.Y H:i:s");
if ($calculate > 18) {
...

 

But it doesn't work.

 

I hope for help!

Link to comment
Share on other sites

Hello,

 

I search for a script which calculates whether a customer is 18 years. At first, I write

 

$calculate = $customer['customers_dob'] - date("d.m.Y H:i:s");
if ($calculate > 18) {
...

 

But it doesn't work.

 

I hope for help!

see if there is an age verification module in the add ons area

Link to comment
Share on other sites

To work out the age use:

 

list($year,$month,$day) = explode("-",$customer['customers_dob']);

$age = (date("Y") - $year) - (date("md") < $month.$day ? 1 : 0);

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...