Forum Moderators: open

Message Too Old, No Replies

Current date and time in Frontpage.

how to display current date and time in frontpage

         

dss_sau

3:14 pm on Apr 12, 2006 (gmt 0)

10+ Year Member



I am using the following code to display the current year on a page:
<!--webbot bot="Timestamp" s-type="edited" S-Format="%Y" -->

I have noticed the "edited" portion and in the code and am curious if that refers to the date when the page was last edited.

Am just concerned that on some pages where the text might not change for a while, i could end up displaying a previous year's value instead of the current year value?

If my assumption is correct - would welcome advise on what may be the correct code to display the current date as opposed to the date when the page was last edited.

Thanks in advance!

Terabytes

3:21 pm on Apr 12, 2006 (gmt 0)

10+ Year Member



<SCRIPT language=javascript1.1>
now = new Date();
day = new Object();
month = new Object();
day[0] = "Sunday";
day[1] = "Monday";
day[2] = "Tuesday";
day[3] = "Wednesday";
day[4] = "Thursday";
day[5] = "Friday";
day[6] = "Saturday";
month[0] = "Jan.";
month[1] = "Feb.";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "Aug.";
month[8] = "Sept.";
month[9] = "Oct.";
month[10] = "Nov.";
month[11] = "Dec.";
year = now.getYear();
if (year < 1000) year += 1900;
document.write(day[now.getDay()] + ", " + month[now.getMonth()] + " " + now.getDate() + ", " + year);
//
</SCRIPT>

Insert this script....

however it relies on the users computer to display the time/date....if the users computer is incorrect (IE 1998), it displays the incorrect time/date..

howe that helps..
Tera

dss_sau

3:46 pm on Apr 12, 2006 (gmt 0)

10+ Year Member



Thanks Terra

Am sorry I should have clarified - was hoping to use a Frontpage feature as opposed to javascript. Besides, as you mentioned - the javascript would pull info from the client machine as opposed to the server and it would be better to rely on the server.

pageoneresults

4:18 pm on Apr 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello dss_sau, Welcome to WebmasterWorld's WYSIWYG Forum!

There are two options that are default in FrontPage for Date and Time Stamps.

  • Date this page was last edited.
  • Date this page was automatically updated.

FrontPage does not have a webbot (that I know of) that will provide the current date and time. There are third party plugins for FrontPage that do this with Jbots being the most popular.

Here is an outline of the default FP Date and Timestamps you have available along with their respective code.

Combined Date and Time Stamps

2006-04-12T09:03:58-0700 - International Date and Time Format

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y-%m-%dT%H:%M:%S%Z" -->

Note: The above webbot I created to adhere to the ISO Date and Time format. It's available for all, no strings attached. ;)

04/12/06

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%m/%d/%y" -->

April 12, 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%B %d, %Y" -->

12 April, 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" -->

12 Apr 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" -->

12 April 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" -->

12/04/06

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d/%m/%y" -->

04.12.06

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%m.%d.%y" -->

04.12.2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%m.%d.%Y" -->

12-Apr-2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d-%b-%Y" -->

2006-04-12

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y-%m-%d" -->

06-04-12

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%y-%m-%d" -->

12-04-06

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d-%m-%y" -->

12-04-2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d-%m-%Y" -->

April, 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%B, %Y" -->

Apr-06

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%b-%y" -->

Wednesday April 12, 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%A %B %d, %Y" -->

Wednesday, 12 April 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%A, %d %B %Y" -->

Wednesday, 12. April 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%A, %d. %B %Y" -->

Wednesday, April 12, 2006

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%A, %B %d, %Y" -->

Time Stamp Examples

09:03

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%H:%M" -->

09:03:58

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%H:%M:%S" -->

09:03 -0700

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%H:%M %Z" -->

09:03:58 -0700

<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%H:%M:%S %Z" -->

[edited by: pageoneresults at 4:38 pm (utc) on April 12, 2006]

dss_sau

4:29 pm on Apr 12, 2006 (gmt 0)

10+ Year Member



Thank you Pageone. I actually picked up your earlier thread (very interseting and useful) on international date and time on Google which lead me to this forum.

I will follow up on your lead. 'tis a pity there is no Frontpage functionality to display the current server date-time info.

As our budget is limited, I think we might see if we can just automatically update the page without any changes and that could then keep the year value current. I am just using this to automatically deliver the correct year for the copyright statement.

pageoneresults

4:31 pm on Apr 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you are using asp, you can pull the current date and time from the server with a small piece of asp script. It isn't dynamic (the seconds don't tick) but it works for what you need. Your pages will need to be .asp though. :(

dss_sau

5:14 pm on Apr 12, 2006 (gmt 0)

10+ Year Member



changing all the pages to .asp

Unfortunately, I have inherited a huge static html site :(

So I am trying to pick my frying pan as opposed to the fire! :)

pageoneresults

5:19 pm on Apr 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do a search for the Jbots addin for FP. That's probably going to be your best option.

No, don't change those file extensions! :)