vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Today's Date: Anywhere you want! (https://vborg.vbsupport.ru/showthread.php?t=104389)

King Kovifor 01-03-2006 10:00 PM

Today's Date: Anywhere you want!
 
Plugin today's date anywhere in the system. Just place the following JAVASCRIPT in the HTML Code.

HTML Code:

<script language="JavaScript">
<!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}
function y2k(number) {
return (number < 1000) ? number + 1900 : number;
}
var months = new makeArray('January','February','March','April','May','June','July','August','September','October','November','December');
var days = new makeArray0('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var today = new Date();
var day  = days[today.getDay()];
var date  = today.getDate();
var month = today.getMonth() + 1;
var year  = y2k(today.getYear());
//-->

</script>

Different Version: https://vborg.vbsupport.ru/showpost....46&postcount=4

Note:

Java taken from freeservers site. I take NO Credit once so ever, it's just instructions.

Snake 01-04-2006 10:33 AM

Thanks, works just fine! :)

Allan 01-04-2006 10:47 AM

Screen please :)

jugo 01-04-2006 10:58 AM

Wouldn't a plugin using php's

Code:

date();
function work just as well....

then set that to a variable and insert it wherever you want.

EDIT: this is for jilly - as requested in PM: (don't mean to be rude and steal your thread, so please let me know if you want me to move this post.)

Install this plugin and insert
Code:

$today
wherever you want to display the date and time.

You can change the display of the date and time by editing the plugin:

Code:

$today = date("F j, Y, g:i a");                // March 10, 2001, 5:16 pm
$today = date("m.d.y");                        // 03.10.01
$today = date("j, n, Y");                      // 10, 3, 2001
$today = date("Ymd");                          // 20010310
$today = date('\i\t \i\s \t\h\e jS \d\a\y.');  // It is the 10th day.
$today = date("D M j G:i:s T Y");              // Sat Mar 10 15:16:08 MST 2001
$today = date("H:i:s");                        // 17:16:17


Rich 01-04-2006 11:38 AM

Hello,

Just to make sure no one gets in trouble, did you get this script from Dynamic Drive? If you did, and you removed their copyright, people can get in trouble for using it with the copyright stripped.

King Kovifor 01-08-2006 09:21 PM

Quote:

Originally Posted by iguanairs
Hello,

Just to make sure no one gets in trouble, did you get this script from Dynamic Drive? If you did, and you removed their copyright, people can get in trouble for using it with the copyright stripped.

Nope, what's Dynamic Drive?

ChurchMedia 01-09-2006 04:49 AM

Quote:

Originally Posted by jugo
Wouldn't a plugin using php's


Code:
date();

function work just as well....

then set that to a variable and insert it wherever you want.

I tried it your way and it just shows up as yyyy-mm-dd (2006-01-08) on the FORUM HOME page. It's fine on other pages...

Ideas?

Paul M 01-09-2006 07:23 AM

The date and time are already available anywhere in vb as $datenow and $timenow (formatted as per your vb options). The year is also available as $copyrightyear.

King Kovifor 01-10-2006 06:09 PM

Quote:

Originally Posted by Paul M
The date and time are already available anywhere in vb as $datenow and $timenow (formatted as per your vb options). The year is also available as $copyrightyear.

I did not know that. Thanks.

radiofranky 07-25-2011 11:03 PM

Quote:

Originally Posted by Paul M (Post 868703)
The date and time are already available anywhere in vb as $datenow and $timenow (formatted as per your vb options). The year is also available as $copyrightyear.


Hi,
I tried putting {vb:raw datenow} in my vb4.14 template but nothing is showing up.

thanks


All times are GMT. The time now is 08:30 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.01171 seconds
  • Memory Usage 1,735KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete