Welcome to the most active Linux Forum on the web.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org Php days calculation
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 10-19-2006, 04:57 AM #1 dylan912 LQ Newbie   Registered: Dec 2004 Distribution: Redhat Posts: 18 Rep: Php days calculation Hi all, How do I calculate the total days by given a date and to present day. Example Given date = 10-10-2006 Currant date = 19-10-2006 (this should define automatically) So total days = 9 If 20-10-2006 it should print 10 This should print total days from the start we enter the date (given date) Please help
 10-19-2006, 05:57 AM #2 hobey LQ Newbie   Registered: Feb 2006 Distribution: SuSE 10.0 Posts: 17 Rep: You could use 'mktime' to get unix timestamps for the two dates. Then compute the difference between the timestamps and you have the seconds between the two dates. Divide by 60*60*24=86400 to get the difference in days.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ahmad82pkn Linux - Networking 0 10-22-2005 08:38 AM russoue Programming 2 07-13-2005 09:51 AM Redhatusr Linux - Software 2 01-07-2005 01:11 PM alaios Programming 3 06-01-2004 01:46 AM mikeshn Linux - General 4 08-27-2003 02:53 PM

All times are GMT -5. The time now is 04:20 PM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -