The Arcive of vBulletin Modifications Site. |
|
Today's Date: Anywhere you want! Details »»
|
|||||||||||||||||||||||||
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> Note: Java taken from freeservers site. I take NO Credit once so ever, it's just instructions. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Thanks, works just fine!
|
|
#3
|
||||
|
||||
|
Screen please
|
|
#4
|
|||
|
|||
|
Wouldn't a plugin using php's
Code:
date(); 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 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
|
|
#5
|
||||
|
||||
|
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. |
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
||||
|
||||
|
Quote:
Ideas? |
|
#8
|
||||
|
||||
|
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.
|
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
|||
|
|||
|
Quote:
Hi, I tried putting {vb:raw datenow} in my vb4.14 template but nothing is showing up. thanks |
![]() |
|
|