PDA

View Full Version : Changing date?


Koutaru
08-06-2004, 05:55 AM
I know I have the oddest requests but here goes

I want the year (2004) to be + 120 so that it's 2124 today. Is that possible and how would I do that?

The reason is I run an RPG that takes place in the future, and I want that role playing feeling to go throughout the entire site

Thanks :) :ninja:

Colin F
08-06-2004, 06:29 AM
I know I have the oddest requests but here goes

I want the year (2004) to be + 120 so that it's 2124 today. Is that possible and how would I do that?

The reason is I run an RPG that takes place in the future, and I want that role playing feeling to go throughout the entire site

Thanks :) :ninja:
You could probably change something in the vbdate() function...

NTLDR
08-06-2004, 09:01 AM
As Colin said, if you wish it to effect all of vB's dates then editing vbdate() would e easiest (and would allow for the real date to be used in the future if wanted).

You'd need to add the number of seconds that 120 years is to the dateline generated (or collected from the database), its around 3784320000 seconds not including any leap years.

Colin F
08-06-2004, 09:09 AM
Now that I think about it, you might have some problems with the unix timestamp limitation of 2038...

Colin F
08-06-2004, 09:17 AM
Try adding this:

$timestamp_adjusted = mktime(date("G", $timestamp_adjusted), date("i", $timestamp_adjusted), date("s", $timestamp_adjusted), date("n", $timestamp_adjusted), date("j", $timestamp_adjusted), (date("Y", $timestamp_adjusted)+120));

to your includes/functions.php, under

$timestamp_adjusted = max(0, $timestamp - $hourdiff);

Koutaru
08-07-2004, 02:51 AM
I hope this is just for the year :) Thanks I'll definately try it and let you know how it goes

Koutaru
08-08-2004, 04:26 AM
No go, it changed my times to

1969 :X yikes! 12-31-1969 02:59 PM was today :p

Also, none of them showed "Today" and "Yesterday" -- not too big of a deal to me but any suggestions?

Colin F
08-08-2004, 08:07 AM
Well, that's probably due to the problem I mentioned above with the limitation of unix timestamps.

I have an idea... I'll get back to you :)

Colin F
08-08-2004, 09:50 AM
Sorry, didn't think of everything :(

My idea was to split the last date and change the year before returning it, but you can't do that because you don't know how the date is formatted.

Brad
08-08-2004, 12:15 PM
You could restrict the function from getting the year in the dateline at all, then apply a hard-coded year to the end of the date.

Koutaru
08-09-2004, 06:39 AM
Sorry, didn't think of everything :(

My idea was to split the last date and change the year before returning it, but you can't do that because you don't know how the date is formatted.
No problem Colin ^_^ thanks for your help!

Brad, will this effect the calendar too? xD