Jump to content

[solved]date diffrence.


redarrow

Recommended Posts

Can somone kindly show me how to show the date left from the below i get a 2 thats wrong lol......

advance thank you.
[code]
<?php
$days_left= date("d-m-y",$record['exspire_date']) - date("d-m-y",$record['added_date']);
?>

added date: 26-08-06 // date format
exspire date: 28-07-07//date format

days left 2// from above verable
[/code]

tried this way aswell.
[code]
<?php
$days_left=$record['exspire_date']-$record['added_date'];
$days_left=date("d-m-y",$days_left);

result but wrong total days left: 03-12-70
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/18701-solveddate-diffrence/
Share on other sites

sorry i want to cleair the above post up, i need to now how many days there are from now to exspire date in a number format.

example

you have 400 days left before account exspired

example but i get a 1
[code]
<?php
$days_left=count(date("d-m-y",$record['exspire_date']));
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/18701-solveddate-diffrence/#findComment-80638
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.