Piyush Posted October 31, 2009 Share Posted October 31, 2009 how to get difference b/w a date of any format suppose YYYY-DD-MM HH:MM:SS and the current date with php.. Link to comment Share on other sites More sharing options...
Synook Posted October 31, 2009 Share Posted October 31, 2009 There are several ways to do it but I would just convert the time string into a timestamp using strtotime() and then subtract the two timestamps from each other. Link to comment Share on other sites More sharing options...
Piyush Posted November 1, 2009 Author Share Posted November 1, 2009 how to subtract it...simply by - operator or something else... Link to comment Share on other sites More sharing options...
Synook Posted November 1, 2009 Share Posted November 1, 2009 You have to use strtotime() to convert them into timestamps first, then since timestamps are just numbers you can subtract them normally. Link to comment Share on other sites More sharing options...
Piyush Posted November 1, 2009 Author Share Posted November 1, 2009 thanks for that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.