current date - simple text

All WYSIWYG Web Builder support issues that are not covered in the forums below.
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
Post Reply
longman
 
 
Posts: 232
Joined: Sat May 19, 2018 1:23 pm

current date - simple text

Post by longman » Mon Jul 02, 2018 2:12 am

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!

User avatar
BaconFries
 
 
Posts: 4934
Joined: Thu Aug 16, 2007 7:32 pm

Re: current date - simple text

Post by BaconFries » Mon Jul 02, 2018 2:25 am

Have you looked in Ready-to-use-Javascript? 'Basic Date'

longman
 
 
Posts: 232
Joined: Sat May 19, 2018 1:23 pm

Re: current date - simple text

Post by longman » Mon Jul 02, 2018 2:51 am

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.

User avatar
BaconFries
 
 
Posts: 4934
Joined: Thu Aug 16, 2007 7:32 pm

Re: current date - simple text

Post by BaconFries » Mon Jul 02, 2018 3:02 am

You will either need to use some form of scripting such as javascript or php.

MGD4me
 
 
Posts: 174
Joined: Tue May 02, 2017 11:56 pm
Location: Canada

Re: current date - simple text

Post by MGD4me » Wed Jul 04, 2018 5:36 am

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 + "," + "&nbsp;" + "&nbsp;" + month + "&nbsp" + date + "<sup>" + suffix + "</sup>" + "&nbsp;" + "&nbsp;" + year);
}
// -->
</script>
<script>
<!--
print_date();
//-->
</script>
</span><br />

Post Reply