vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Local time and date in post, pm, usernotes and profile v1.5 (https://vborg.vbsupport.ru/showthread.php?t=60863)

Boofo 01-28-2004 04:34 PM

It is at the end of these lines (highlighted in yellow):

// Local Date and Time in Profile
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Profile

Zelda-King 01-28-2004 04:48 PM

Quote:

Originally Posted by Boofo
It is at the end of these lines (highlighted in yellow):

// Local Date and Time in Profile
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Profile

Ah, so it is. I can only imagine why my first search didn't work. Anyway, the results to that change are disastrous;

Local Time:
11:49 AM
Local Date:
12-13-2006

(Actual time being 06:49pm)

Boofo 01-28-2004 04:51 PM

Quote:

Originally Posted by Zelda-King
Ah, so it is. I can only imagine why my first search didn't work. Anyway, the results to that change are disastrous;

Local Time:
11:49 AM
Local Date:
12-13-2006

(Actual time being 18:49pm)

Ok, I just wanted to be sure it was that far off. ok, with the hack like it is when you go back to the original code, how far off are we?

Zelda-King 01-28-2004 04:57 PM

With my offset as 0;

Local Time:
04:59 PM
Local Date:
01-28-2004

Actual local time being 06:59pm.

For the record, I have my DST settings set to be automatically detected.

Boofo 01-28-2004 05:10 PM

Quote:

Originally Posted by Zelda-King
With my offset as 0;

Local Time:
04:59 PM
Local Date:
01-28-2004

Actual local time being 06:59pm.

For the record, I have my DST settings set to be automatically detected.

Ok, in your Admin CP, do you have this set to NO?

Enable Daylight Savings (dstonoff)

Zelda-King 01-28-2004 05:16 PM

Yes I did. Enabling it hasn't changed anything though, apparantly. My time is still two hours behind.

Boofo 01-28-2004 05:21 PM

That's really strange, because I have been running it on my forums for 3 weeks now and it has never faltered once. I wanted to thoroughly test it before I released it.

I will look at the code and figure out what is going on. I will post a fix here shortly. Please bear with me. I WILL get this working for you. ;)

Is everyone else having the same problem?

Natch 01-28-2004 06:57 PM

Yup - like I said mine is one hour out for me (and I am in DST)

Boofo 01-28-2004 11:42 PM

Ok. Try this for the code in the member.php and let me know if it fixes it in the profile. If it does, I will change the rest of the code and get it to you.

In member.php, replace:

PHP Code:

// Local Date and Time in Profile
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['timezoneoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Profile 

with:

PHP Code:

// Local Date and Time in Profile
    
$post['tzoffset'] = $post['timezoneoffset']; 
    if (
$post['dstonoff']) 
     { 
        
// DST is on, add an hour 
        
$post['tzoffset']++; 
    }
$post['localtime'] = date($vboptions['timeformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
$post['localdate'] = date($vboptions['dateformat'], TIMENOW+($post['tzoffset']-$vboptions['timeoffset'])*3600);
// Local Date and Time in Profile 


Natch 01-29-2004 12:42 AM

You - sir - are a gentleman and a scholar :)

That's done the trick :D :D


All times are GMT. The time now is 09:51 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.01313 seconds
  • Memory Usage 1,749KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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