TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-20-2011, 01:56 AM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2010
Posts: 13
Thanks: 0
pepelepew1962 is on a distinguished road
Default Special Date Calculation ...

Hello, I REALLY need some help creating a special date calculation. I want to calculate the difference between
2 mysql fields but display the difference as:
//
//
02:19:21
//
02 is days
19 is hours
21 as minutes
//
//
$Dater01 = $row['tblTabler00_Dater01']; //2010-12-16 23:45:00
$Dater02 = $row['tblTabler00_Dater02']; //2010-12-14 04:24:00
//
$Dater03 = $Dater01 - $Dater02
//
Important is that a negative amount is valid, meaning it is overdue. Any help would be greatly appreciated.
//
Regards,
pepelepew1962 is offline  
Reply With Quote
Old 02-20-2011, 09:53 AM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

MySQL datediff() and MySQL timediff() could be your friends here, just parse the returned values into the format you need..
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
format date to "10 Jan 2011" captainmerton Absolute Beginners 3 01-10-2011 06:38 PM
add special characters to DB? arale Absolute Beginners 0 07-08-2009 04:33 AM
PHP Access Date problems. mtsang Absolute Beginners 4 06-27-2009 04:59 PM
help me figure out this date thing sarmenhb Absolute Beginners 5 09-15-2008 04:20 PM
Need more ideas for date and time class Wildhoney General 2 01-18-2008 02:22 PM


All times are GMT. The time now is 03:59 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design