The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I am trying to modify:
Code:
<script type="text/javascript">d = new Date();y = d.getFullYear();document.write(y);</script> I'm pretty sure the variables I need are: today.getMonth () and today.getDate() I just can't seem to get the syntax correct... |
|
#2
|
|||
|
|||
|
You don't need <script type="text/javascript">, <script> is ok.
Code:
<script>
var d = new Date();
const options = { year: 'numeric', month: 'long', day: 'numeric' };
document.write(d.toLocaleDateString('en-US', options));
</script>
Code:
<p id="datedemo"></p>
<script>
var d = new Date();
const options = { year: 'numeric', month: 'long', day: 'numeric' };
document.getElementById("datedemo").innerHTML = d.toLocaleDateString('en-US', options);
</script>
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|