vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with redirect and localdate (https://vborg.vbsupport.ru/showthread.php?t=46332)

Xenon 12-06-2002 09:54 PM

ahh i see what you mean now ;)

open global.php

find
PHP Code:

$timenow=vbdate($timeformat,time()); 

there replace $timeformat with a new format string :)

Boofo 12-07-2002 02:42 AM

Thank you. Now all I need to know is how you mean the "format string". Do I need to set it up somewhere else first? I'm sorry to sound so simple on this, but it has me totally baffled. :)

Xenon 12-07-2002 11:31 AM

instead of $timeformat use this (f.e.) string:
PHP Code:

"D H:i m-d-Y" 


Boofo 12-07-2002 04:32 PM

Ok, but will that work according to the users offset?

Xenon 12-07-2002 07:28 PM

yes it will, because vbdate function is used ^^

Boofo 12-08-2002 04:28 PM

Thank you, it worked. here's what I have now:

Code:

$timenow=vbdate("g:i a, D, M j, Y",time());
How would I get it to say this?

12:22 pm on Sun, Dec 8, 2002.

instead of:

12:22 pm, Sun, Dec 8, 2002.

Xenon 12-08-2002 05:32 PM

hmm, try this one:

PHP Code:

$timenow=vbdate("g:i a"time()) . " on " vbdate("D, M j, Y",time()); 


Boofo 12-08-2002 05:46 PM

Perfect! Worked like a charm. Thank you very much, kind sir. :)

I need to ask, though, what are the 2 periods for in the code?

Xenon 12-08-2002 06:06 PM

well, you have to divide the code, because the formatstring would be converted into numbers or other things

vbdate("g:i a", time()) gives out: "12:22 pm"
. " on " . adds the " on " to the string
and vbdate("D, M j, Y",time()); adds the "Sun, Dec 8, 2002"

Boofo 12-08-2002 06:36 PM

Ahh, ok, that makes sense now. Would it also work like this?

$timenow=vbdate("g:i a", time())." on ".vbdate("D, M j, Y",time());

or do the spaces have to be there, too?


All times are GMT. The time now is 04:15 PM.

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.01027 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_php_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