Download your favorite Linux distribution at LQ ISO.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org Php days calculation
 User Name Remember Me? Password
 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, 05: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, 06: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.

 Thread Tools Search this Thread Search this Thread: Advanced Search

 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 09:38 AM russoue Programming 2 07-13-2005 10:51 AM Redhatusr Linux - Software 2 01-07-2005 02:11 PM alaios Programming 3 06-01-2004 02:46 AM mikeshn Linux - General 4 08-27-2003 03:53 PM

LinuxQuestions.org

All times are GMT -5. The time now is 04:33 AM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -
 Advertisement
 My LQ
 Write for LQ LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
 Syndicate Latest Threads   LQ News Twitter: @linuxquestions Facebook: linuxquestions Google+: linuxquestions