Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : The Site : UBB for timezone-independant date/times.
New Topic New Poll Post Reply
Poster Message
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon UBB for timezone-independant date/times. (+1)  
An unimportant, minor request, but I'll put it in while I'm thinking about it...

I'm picturing a UBB code like this:

[localtime]12/14/2004 11:00pm[/localtime]

The date/time in the middle is universal mean time (Greenwich mean time). But in people's browsers it gets adjusted to their local time via some PHP magic. So then I could post a message containing this:

Contest entries must be submitted by Local Time:12-14-2004 at 11:00 PM.

...and if you were in Amsterdam and had set your timezone in your profile to match, the message would say:

Contest entries must be submitted by 12/15/2004 12:00am.

Another useful UBB along the same lines that would be ultra-deluxo to have:

That gives you [untiltime]12/14/2004 11:00pm[/untiltime] to come up with a contest entry.

...which generates something like:

That gives you negative 1033 weeks, 2 days to come up with a contest entry.

-Erik


[Edited by Schik on 09-21-2004 at 02:48 PM GMT: Changed the examples to use the real thing :)]

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-15-2004 at 10:31 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Frodo
Level: Goblin
Rank Points: 25
Registered: 07-24-2004
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
ErikH2000 wrote:
The date/time in the middle is universal mean time (Greenwich mean time). But in people's browsers it gets adjusted to their local time via some PHP magic. So then I could post a message containing this:

Contest entries must be submitted by [localtime]12/14/2004 11:00pm[/localtime].

...and if you were in Amsterdam and had set your timezone in your profile to match, the message would say:

Contest entries must be submitted by 12/15/2004 12:00am.
Uhm, I guess it would actually show 12/15/2004 1:00am right now, given that we are on daylight saving right now...

(Sorry, just had to pick that nit *G*)

____________________________
Grtz,

Frodo
09-15-2004 at 10:35 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Mattcrampy
Level: Smitemaster
Avatar
Rank Points: 2388
Registered: 05-29-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Hoo boy, that's one for Schik.

UBB isn't dynamic, which is why this hasn't been done before. We'd have to rewrite the UBB code to be able to have it insert a piece of Javascript or something...

Hang on... we can just put in some Javascript, I guess.

Matt

____________________________
What do you call an elephant at the North Pole?
Click here to view the secret text

09-18-2004 at 02:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5416
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Mattcrampy wrote:
Hoo boy, that's one for Schik.

UBB isn't dynamic, which is why this hasn't been done before. We'd have to rewrite the UBB code to be able to have it insert a piece of Javascript or something...
Nah, I'll just do it all in PHP. The [url] code is done in PHP already, so it's not like we'd be setting a precedent we didn't want to set.

Testing edit timestamps

[Edited by Schik at Local Time:11-10-2004 at 09:32 PM]

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
09-18-2004 at 09:22 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
gamer_extreme_101
Level: Smitemaster
Avatar
Rank Points: 1939
Registered: 03-07-2004
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
If you end up doing the localtime UBB, can you make it fit in the [Edit] stamp whenever you edit a message? That would be mucho handy for a lot of people...

____________________________
--That guy with a million different aliases since he doesn't like this name anymore.
09-20-2004 at 12:06 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5416
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (+2)  
ErikH2000 wrote:
I'm picturing a UBB code like this:
I needed to work on something fun, so I did this. With limited testing, it seems to work pretty nicely.

You can use dates like:
10/16/2004 12:00 PM
October 16, 2004 12:00pm
16 October 2004 12:00pm

It will always output in the same format. At some point maybe I'll let the user configure that in their profile, but I haven't done that yet.

untiltime takes the same format of dates, and uses the same function as the timed polls to generate text describing how far away the event is.

I went ahead and changed new post edits to use the localtime tag, but old ones will remain UTC.

Edit: I could have sworn the edit times were working... here's a fix test.


[Edited by Schik at Local Time:09-21-2004 at 06:36 PM]

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
09-21-2004 at 04:56 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
At Local Time:09-21-2004 at 07:10 PM I began writing this message. You have negative 1045 weeks, 2 days to read it while it is still fresh.

-Erik

[Edited by ErikH2000 at Local Time:09-21-2004 at 10:09 PM: Doh. I did not follow MY OWN specification.]

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-21-2004 at 06:07 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Hmm. I think it's off by one hour. My profile is set correctly to PST -8. The GMT times were 10 after this hour and 20 after this hour. Both of them are coming through as an hour from now.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-21-2004 at 06:12 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3264
Registered: 07-05-2004
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
[Edited by ErikH2000 at 01/01/1970 12:59AM: Doh. I did not follow MY OWN specification.]
Am I hallucinating? Or is there something I don't understand?

[Edited by Doom at Local Time:09-21-2004 at 06:49 PM]
09-21-2004 at 06:16 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (+1)  
Oh, never mind me and my bumbling. First I put in local times and was surprised it didn't work, because... well, I'm just dumb. Then I put in universal times and aside from the glitch I just reported, it worked perfect. So the amusing thing for me was that Schik made his commands work *EXACTLY* like I asked them to, but I still didn't write them correctly the first try.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-21-2004 at 06:19 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Oneiromancer
Level: Legendary Smitemaster
Avatar
Rank Points: 2936
Registered: 03-29-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
So yeah, the edited by date is wrong, hehe. As for the hour difference...hmm, I have mine set to GMT -8 but I know that Daylight Savings Time is entering into it somewhere. On other boards I have to set it manually, GMT -7 in the summer, but on this one it's done automatically so that could be part of it.

Game on,

____________________________
"He who is certain he knows the ending of things when he is only beginning them is either extremely wise or extremely foolish; no matter which is true, he is certainly an unhappy man, for he has put a knife in the heart of wonder." -- Tad Williams
09-21-2004 at 06:20 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
As a coder, I should know by now that off-by-one errors on times are almost always because of DST calcs. Yeah, I entered in GMT with DST adjustment, and that set things forward an hour. So there are no known bugs to fix.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
09-21-2004 at 06:48 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Tim
Level: Smitemaster
Avatar
Rank Points: 1979
Registered: 08-07-2004
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
ErikH2000 wrote:
At 09/21/2004 8:10PM I began writing this message. You have 3 hours, 14 minutes ago to read it while it is still fresh.
I must say, this looks pretty impressive English.

So that's what it will say when I'm too late. :)

Are you sure you want that ago in there?

-- Tim



____________________________
The best way to lose customers is to let little kids running loose on a forum with too many mod points.
09-21-2004 at 10:37 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5416
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Tim wrote:
ErikH2000 wrote:
At 09/21/2004 8:10PM I began writing this message. You have 3 hours, 14 minutes ago to read it while it is still fresh.
I must say, this looks pretty impressive English.

So that's what it will say when I'm too late. :)

Are you sure you want that ago in there?
Well, it's gotta say SOMETHING if it's in the past. Now that I see it in use, yeah, sticking ago at the end isn't all that smart. Just put a big "-" at the front? Ummm...

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
09-21-2004 at 10:56 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
wackhead_uk
Level: Smiter
Avatar
Rank Points: 352
Registered: 06-21-2004
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
When I post sometihg it says that I posted it an hour behind the actual time, and if someone posts something straightaway, then it thinks they posted it an hour ago.
09-22-2004 at 11:13 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
eytanz
Level: Smitemaster
Avatar
Rank Points: 2708
Registered: 02-05-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
[localtime[/lb] should be added to the forum help page.

____________________________
I got my avatar back! Yay!
09-22-2004 at 01:45 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (+1)  
This is very nice, but I think [localtime] should show the name of the current timezone as well (to distinguish [localtime]'d times from unlocal ones).

Also, having it show 24-hour time if that's selected in the profile would be great :P

- Gerry
10-06-2004 at 12:59 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
DiMono
Level: Smitemaster
Avatar
Rank Points: 1181
Registered: 09-13-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Check this out:

[untiltime]10/20/2004 12:00am[/untiltime]: negative 1041 weeks, 2 days
[untiltime]10-20-2004 12:00am[/untiltime]: negative 2857 weeks, 1 day

Could the parser allow - as a valid delimiter? That slight difference made for a very amusing typo in my contest thread.

____________________________
Deploy the... I think it's a yellow button... it's usually flashing... it makes the engines go... WHOOSH!
10-16-2004 at 11:35 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
DiMono
Level: Smitemaster
Avatar
Rank Points: 1181
Registered: 09-13-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Another seperate request: If you leave out the date part of a [localtime] tag, could it just show time of day instead of date too? I'm running the contest over there, and it got sort of annoying always having the date included with the time, when everything's happening on the same day.

____________________________
Deploy the... I think it's a yellow button... it's usually flashing... it makes the engines go... WHOOSH!
10-17-2004 at 08:40 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
AlefBet
Level: Smitemaster
Rank Points: 979
Registered: 07-16-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
Hmm... I think the localtime tags aren't taking into account Daylight Savings Time (at least here in the MST time zone). I have a post with an edit time about 50 minutes before the actual post time.

____________________________
I was charged with conspiracy to commit jay-walking, and accessory to changing lanes without signaling after the fact :blush.

++Adam H. Peterson
11-02-2004 at 08:10 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5416
Registered: 02-04-2003
IP: Logged
icon Re: UBB for timezone-independant date/times. (0)  
AlefBet wrote:
Hmm... I think the localtime tags aren't taking into account Daylight Savings Time (at least here in the MST time zone). I have a post with an edit time about 50 minutes before the actual post time.
I believe I've fixed this.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
11-10-2004 at 09:49 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : The Site : UBB for timezone-independant date/times.
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.