This Forum has been archived

Forums: Admin Central Index Technical Help Time...I hate time
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

That is, this weird, weird system of 24 hours in a day and 60 minutes in an hour is driving me up a wall.

I need to create a template that will take two user inputs, in some convenient hour and minute format (24 hour for the sake of my sanity; support for 12-hour and all the convoluted ways users might represent "am" or "A.M." or "Am" and "PM" is WAY to freaking hard), then spit-out an altered version based on the offset given (e.g. -3:30 , yes, that's minutes in a time zone...have to support the weirdos...uh...). It also needs to display the information provided for the offset/timezone as regular text (complicating having the user input an operand for the minutes parameter of their timezone offset dooflicky).

So...any tips? Just...general tips from anyone who might have experienced this maddening thing before? (I'm guessing it'd be smart to convert everything to Unix time codes for calculation and then use the result for display. Still, it's a bit odd considering I'm not looking for a specific dates, just hours and minutes. Will that actually work? I can't dip into negative time codes or explosions will ensue.)

Ideas on making my life easier most welcome. :) --Cphoenix (talk) 21:10, December 8, 2011 (UTC)

Right now it's looking like #time , despite it supposedly accepting everything that PHP strtotime() does, doesn't actually. So calculations within the date/time object's field doesn't accept the PHP format for offset, e.g. "+0430", "GMT-04:30", or "-04:30". It looks like I'll have to make a (long and annoying) #switch function to check against every possible time zone, and output the relative text that #time will accept, e.g. "- 4 hours - 30 minutes". Bugger. Am I right, or is there something I'm missing here? --Cphoenix (talk) 21:33, December 8, 2011 (UTC)

Ah well, I made my #switch functions and all is well. But I'd still love to hear tips and such. --Cphoenix (talk) 22:45, December 8, 2011 (UTC)