MyBB Community Forums

Full Version: myCODE time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It would be supremely awesome to have a mycode tag that allows a user to put in a time surrounded by some code tag that then translates that time to each users User CP set time zone.

So for example I'm in US Eastern. If I was talking about an event that was going to happen at 6:15pm I could type:

[time="GMT -5:00"]18:15[/time]

And on a user in the Pacific Northwest it would appear as 15:15


This feature already sort of happens in the calendar system, but the ability to mycode it into posts would be useful - at least to my userbase.

-Olds
I actually quite like this idea Smile The amount of times I have seen x.xx timezone: GMT -x use y.com for timezone conversion :o

Would certainly make lives easier and would love to see this released, if not as part of the core then for someone to take it up and release it Smile
I'll develop a plugin tomorrow for this and if the rest of the team like it we can implement it into the core Wink
I think this is a great idea. Nice job.
Extremely interesting! Nice work.

If the user left out the parameter, would GMT/UTC be presumed?
Not everyone remembers their timezones. It would be nice to insert the user timezone based on their settings is only [time] is provided. So make [time] become [time='GMT-5:00'] before saving into the DB.
(2013-05-01, 09:47 PM)Tomm M Wrote: [ -> ]If the user left out the parameter, would GMT/UTC be presumed?

Why not use the users time(we set it on sign-up or in the user CP after all)? Then for guests probably use the boards time-zone.
My thoughts so far:
[time=zone]Time[/time] will convert "Time" to the viewers Timezone (as suggested here)
[time]Time[/time] will assume that "Time" is the Timezone of the writer and will convert to the viewers Timezone (as Alex suggested)
I'll write a simple plugin now to do this and afterwards I'll make a Pull Request so SQA can test it before implementing Wink
If that were important, I'd do it without bbcode, it's possible to recognize xx:xxGMT. I'd show it as abbreviation (dotted underline), with a small clock icon and a tooltip.
Sleepy 23:30GMT

I don't think it's possible to reliable convert time - time difference is not constant, it depends on date...
https://github.com/JN-Jones/Timezone-MyCode
Usage:
[time]15:54[/time]
[time=GMT +2]15:27[/time]
[time=+5:30]06:59[/time]
Pages: 1 2