vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Changing date? (https://vborg.vbsupport.ru/showthread.php?t=68040)

Koutaru 08-06-2004 05:55 AM

Changing date?
 
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

Quote:

Originally Posted by Koutaru
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:

PHP Code:

    $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.


All times are GMT. The time now is 07:08 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01010 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete