Event Duration Format

I'm refining our "add to calendar" functionality for events and have run into a problem.


I'm trying to build a url like <a href="http://calendar.yahoo.com/?v=60&amp;title=XXX&ST=20110412T180000&DUR=0100&url=URL">Add to Yahoo Calendar</a> using event keywords.



But Rather than a start and end time, Yahoo Calendar requires a duration parameter in the HHMM format.



My question: Is there any way to format the %event_duration% keyword in produce the required format? At the moment it prints out a readable duration e.g "1 hour and 30 minutes".



Or is there a combination of other keywords/modifiers to produce the required format?



If not I'm thinking I need to post all these params to a php script and do all the computations there.

What I would do is use javascript, check out this link: http://bytes.com/topic/javascript/answers/635388-calculate-duration-between-two-dates


So, basically you could print the start and end keyword (might have to use php date keywords to get the custom you want) then using js convert those to seconds then do your calculate between the two. It shouldn't be that hard and could be achieved in one nice small function. :slight_smile: