Current location: Hot Scripts Forums » Programming Languages » PHP » Date Issue

Date Issue

Reply
  #1 (permalink)  
Old 07-09-09, 10:18 AM
Oxide Oxide is offline
New Member
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Date Issue

Hi,

I am looking for a way to find out the number of minutes between two times.

The times are in the format of "10:00 AM" and "12:00 PM" which are flexible to change
(being used in a event planner).

I have been trying to find a solution for hours, but am yet to find one.

Any help would be appreciated.

Regards.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-09-09, 11:17 AM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community VIP
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,405
Thanks: 1
Thanked 0 Times in 0 Posts
You could always convert the text being sent into a unix timestamp and then do math based on that... See PHP: strtotime - Manual

The timestamps are in seconds, so just subtract and divide by 60 to get minutes until the event.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-09-09, 12:10 PM
Oxide Oxide is offline
New Member
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for that. I had tried that function earlier and it kept returning null...

Found it out it was completely my fault as I was adding AM and PM to the end of 24 hour dates eg. 13:00 PM.

I knew it had to be something simple.


Thanks agian.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date in VB getting format right? budemeadows Visual Basic 6 11-13-08 10:33 AM
date format mysql and php Deansatch PHP 9 03-28-08 05:06 AM
wierd date() issue jonnekke PHP 7 08-15-07 09:52 AM
converting date-string to Date object UnrealEd Everything Java 4 05-15-07 07:20 PM
js date franches JavaScript 1 11-25-04 09:42 AM


All times are GMT -5. The time now is 10:02 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.