zester
New Member
- Messages
- 23
- Reaction score
- 0
- Points
- 0
HI all
I need to do a lot of adding and subtracting dates, so I was trying to make a function for it, but I just can’t get dates to add or sub right. Dose php have a built-in function for this, or do any of you know where to find one. I am tiring to subtract the last login date from today’s date to get time sense last login in YYYY-MM-DD-HH-II-SS
This is what I have
$date = date('Y-m-d H:i:s');
$Lastlogin=$rows['Lastlogin']; (from my DB in the same format as $date)
$away = $date - $Lastlogin;
But
$away always = 2008
And I will need to do more adding and subtracting in the program so I would like have something like this
SubDate(date1,date2)
And
ADDdate(date1,date2)
Can anyone help me.
[FONT="]Zester out[/FONT]
I need to do a lot of adding and subtracting dates, so I was trying to make a function for it, but I just can’t get dates to add or sub right. Dose php have a built-in function for this, or do any of you know where to find one. I am tiring to subtract the last login date from today’s date to get time sense last login in YYYY-MM-DD-HH-II-SS
This is what I have
$date = date('Y-m-d H:i:s');
$Lastlogin=$rows['Lastlogin']; (from my DB in the same format as $date)
$away = $date - $Lastlogin;
But
$away always = 2008
And I will need to do more adding and subtracting in the program so I would like have something like this
SubDate(date1,date2)
And
ADDdate(date1,date2)
Can anyone help me.
[FONT="]Zester out[/FONT]