Hi guys,
How can i have the current day date in text format that updates automatically every day? in this format, example "Monday, July 2, 2018"
Thanks!
current date - simple text
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
- BaconFries
-
- Posts: 5140
- Joined: Thu Aug 16, 2007 7:32 pm
Re: current date - simple text
Have you looked in Ready-to-use-Javascript? 'Basic Date'
Re: current date - simple text
I was gonna avoid using Java script, so that's the only way, right?
My aim was using less and less java scripts on my pages.
My aim was using less and less java scripts on my pages.
- BaconFries
-
- Posts: 5140
- Joined: Thu Aug 16, 2007 7:32 pm
Re: current date - simple text
You will either need to use some form of scripting such as javascript or php.
Re: current date - simple text
Make sure your page type is php, eg: index.php
Select Insert HTML , and place the the code block wherever you wish to have the date displayed.
Insert this code: (Change the font size and color as you wish)
<SPAN STYLE="color: gold; font-size: 16pt">
<script language="JavaScript" type="text/javascript">
<!--
var
month = new Array();
month[0]="Jan";
month[1]="Feb";
month[2]="Mar";
month[3]="Apr";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="Aug";
month[8]="Sept";
month[9]="Oct";
month[10]="Nov";
month[11]="Dec";
var
day = new Array();
day[0]="Sunday";
day[1]="Monday";
day[2]="Tuesday";
day[3]="Wednesday";
day[4]="Thursday";
day[5]="Friday";
day[6]="Saturday";
today = new Date();
date = today.getDate();
day = (day[today.getDay()]);
month = (month[today.getMonth()]);
year = (today.getFullYear());
suffix = (date==1 || date==21 || date==31) ? "st" : "th" &&
(date==2 || date==22) ? "nd" : "th" && (date==3 || date==23) ? "rd" : "th"
function print_date()
{
document.write(day + "," + " " + " " + month + " " + date + "<sup>" + suffix + "</sup>" + " " + " " + year);
}
// -->
</script>
<script>
<!--
print_date();
//-->
</script>
</span><br />
Select Insert HTML , and place the the code block wherever you wish to have the date displayed.
Insert this code: (Change the font size and color as you wish)
<SPAN STYLE="color: gold; font-size: 16pt">
<script language="JavaScript" type="text/javascript">
<!--
var
month = new Array();
month[0]="Jan";
month[1]="Feb";
month[2]="Mar";
month[3]="Apr";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="Aug";
month[8]="Sept";
month[9]="Oct";
month[10]="Nov";
month[11]="Dec";
var
day = new Array();
day[0]="Sunday";
day[1]="Monday";
day[2]="Tuesday";
day[3]="Wednesday";
day[4]="Thursday";
day[5]="Friday";
day[6]="Saturday";
today = new Date();
date = today.getDate();
day = (day[today.getDay()]);
month = (month[today.getMonth()]);
year = (today.getFullYear());
suffix = (date==1 || date==21 || date==31) ? "st" : "th" &&
(date==2 || date==22) ? "nd" : "th" && (date==3 || date==23) ? "rd" : "th"
function print_date()
{
document.write(day + "," + " " + " " + month + " " + date + "<sup>" + suffix + "</sup>" + " " + " " + year);
}
// -->
</script>
<script>
<!--
print_date();
//-->
</script>
</span><br />