vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Time and date at the server (https://vborg.vbsupport.ru/showthread.php?t=75571)

rjordan 02-01-2005 09:57 PM

Time and date at the server
 
How would I go about getting the time and date at the server regardless of who is logged in? I have seen the following:

PHP Code:

$date vbdate($vboptions['dateformat'], TIMENOW);
$time vbdate($vboptions['timeformat'], TIMENOW); 

Assume that me and someone an hour ahead of me run the above code at the same time. When I log in, I am in the same time zone as the server. If someone an hour ahead of me logs in, the above code gives an hour difference.

Is there a magic way to craft the above code to give me the results I am looking for?

Jolten 02-01-2005 10:40 PM

yes that code will give the user the correct current time based upon their offset values.

rjordan 02-02-2005 12:47 AM

Quote:

yes that code will give the user the correct current time based upon their offset values.
While I appreciate the reply, that is why I am asking for assistance. I would like to have it based off of the settings in AdminCP to return something like 5:48pm EST or similar if at all possible.

Jolten 02-02-2005 01:59 AM

If you just want the server time you can use the following
Code:

$dtnow = date(m-d-Y H:i:s);
Then just use print $dtnow; or echo $dtnow; to call the time.

That will return 02-02-2005 13:25:23.

Then you can add the EST or whatever.

For more date options try www.php.net

rjordan 02-02-2005 02:33 AM

Thanks for the input, but I was PMed with this solution (which I thought I would share if the question were to come up again). It seems to work as requested.

PHP Code:

$date vbdate($vboptions['dateformat'], TIMENOW0100);
$time vbdate($vboptions['timeformat'], TIMENOW0100); 



All times are GMT. The time now is 08:40 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.01099 seconds
  • Memory Usage 1,723KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete