Modifying the FrontPage Date/Time Web Component
If you've ever inserted a date or time using Date and Time on the Insert menu in FrontPage, you may have wondered how you can change the date and/or time format. Well, you're not alone. We recently had the following comment from a customer asking for just this kind of information.
I want to know the parameters that can be changed, and how to change them, such as language to use - my web server is in Germany but I want to display months in English, not German, and UK time, not German. and eg what do the following mean: s-format="%d %B %Y" and what are the options for these and other parameters.
Before I tell you how you can change the date and time formats, I should first explain that the date and time component is a server-side date and time component, which means that it displays the time on the server not the time on the client, so there's no way to specify a time zone (or in the case of the above comment, UK time instead of German time). However, formatting is another thing altogether. By changing the value of the s-format parameter, you can change how the date and time displays.
Let's backup a bit. When you insert a date or time using the Date/Time Web component in FrontPage, FrontPage inserts webbot code. This code looks somewhat like the following:
<!--webbot bot="Timestamp" S-Type="REGENERATED" S-Format="%m/%d/%Y %I:%M %p" -->
The bot parameter specifies "Timestamp." This is what tells the FrontPage Server Extensions which Web component the webbot is using. You can't change this parameter without completely wiping out your date or time. (I know this seems like it should go without saying, but ... well, I've learned that almost nothing can go completely without saying.) However, the other two parameters, S-Type and S-Format, can be edited.
The S-Type parameter can have values of "EDITED" and "REGENERATED." Other values don't necessarily break the webbot, but they also don't mean anything. These are the only values that FrontPage generates from the Date and Time dialog box, but to be completely honest, I didn't really notice a difference between the dates and/or times that these two values generate.
S-Format can have any combination of several values, and the ones that you use will affect how the date and/or time displays. The following table provides a list of possible values and a description of each value. (By the way, casing is critically important here. For example, an uppercase M returns the minutes while a lowercase m returns the month.)
The examples in the following section use the following date/time as a guide:
Friday, December 17, 2004 06:29:42 PM
Parameter Value | Description | Example |
---|---|---|
%A | Day of the week in long format. (Date) | Friday |
%a | Day of the week in short format. (Date) | Fri |
%B | Month spelled out in long format. (Date) | December |
%b | Month spelled out in short format. (Date) | Dec |
%m | Month in number format. (Date) | 12 |
%d | Day of the month. (Date) | 17 |
%Y | Year in long format. (Date) | 2004 |
%y | Year in short format. (Date) | 04 |
%I | Hour in 12-hour format. (Time) | 06 |
%H | Hour in 24-hour format. (Time) | 18 |
%M | Minutes. (Time) | 29 |
%S | Seconds. (Time) | 42 |
%p | Shows PM or AM. (Time) | PM |
You can create date and time formats using any combination of the above parameter values. In addition, as long as a percent sign (%) preceeds each parameter value that indiates a date or time element, you can use extra characters, symbols, and spaces between these parameter values. For example, you could create the date/time as shown in the example preceeding the table by using an S-Format value of "%A, %B %d, %Y %H:%M:%S %p".
Note You can use the percent sign (%) as a symbol by placing two percent signs together (%%). The FrontPage Server Extensions see this as an escape character sequence and display a single percent sign.
Before concluding, I should note that the date and time displayed when you use the Date/Time Web component is the date and/or time a page was saved NOT the current date or time on the server or a visitor's computer. For the current date or time, you would need to use server-side scripting, such as ASP, to get the server's date or time or client-side scripting, such as JavaScript, to get the date or time on the visitor's computer. (For JavaScript that displays the date and/or time, see Dates, dates, and more dates...).
Comments
- Anonymous
December 27, 2004
Lisa, how about a New Year's post of your favorite work-related blogs? :o) - Anonymous
December 27, 2004
Good idea, Gandalfe. Stay tuned... - Anonymous
May 16, 2005
Thanks for this helpful summary. However, every time I enter a datestamp in FrontPage, it comes up as with two digits (ie dd). This is fine after the 10th of the month but I hate, for example, 06 May - the leading zero is so unnecessary/unsightly (you would never write that!). Is there any (simple) way I can insert dates without the leading zero ie d instead of dd (as per Excel formats etc)? - Anonymous
September 08, 2005
The comment has been removed - Anonymous
March 23, 2006
Very good details and new. keep it posted. - Anonymous
May 02, 2006
Very Good - Anonymous
August 26, 2006
Very many thanks for a good work. Nice and useful. Like it! - Anonymous
September 12, 2006
good site - Anonymous
September 12, 2006
good site - Anonymous
September 13, 2006
good site - Anonymous
September 14, 2006
The comment has been removed - Anonymous
September 14, 2006
Very interesting. - Anonymous
September 14, 2006
Very interesting. - Anonymous
September 15, 2006
The comment has been removed - Anonymous
September 16, 2006
The comment has been removed - Anonymous
September 16, 2006
Very interesting. - Anonymous
September 16, 2006
Very interesting. - Anonymous
September 18, 2006
Best site, good job! This i found in internet <a href="http://hydrocodone-l.blogspot.com/">Hydrocodone</a>">http://hydrocodone-l.blogspot.com/">Hydrocodone</a> [url=http://hydrocodone-l.blogspot.com/]Hydrocodone[/url] goodbye! - Anonymous
September 18, 2006
Best site, good job! This i found in internet <a href="http://hydrocodone-l.blogspot.com/">Hydrocodone</a>">http://hydrocodone-l.blogspot.com/">Hydrocodone</a> [url=http://hydrocodone-l.blogspot.com/]Hydrocodone[/url] goodbye! - Anonymous
September 19, 2006
Best site, good job! This i found in internet <a href="http://hydrocodone-l.blogspot.com/">Hydrocodone</a>">http://hydrocodone-l.blogspot.com/">Hydrocodone</a> [url=http://hydrocodone-l.blogspot.com/]Hydrocodone[/url] goodbye! - Anonymous
September 19, 2006
Nice site <a href="http://debt-consolidation-loan-c.blogspot.com/">Debt">http://debt-consolidation-loan-c.blogspot.com/">Debt Consolidation</a> [url=http://debt-consolidation-loan-c.blogspot.com/]Debt Consolidation[/url] bye! - Anonymous
September 22, 2006
The comment has been removed - Anonymous
September 22, 2006
Thanks for the great tips about <a href="http://cashback.50megs.com/best-interest-rate.html"">http://cashback.50megs.com/best-interest-rate.html" title="best interest rate">best interest rate</a> and [URL=http://cashback.50megs.com/best-interest-rate.html]best interest rate[/URL] - Anonymous
September 22, 2006
The comment has been removed - Anonymous
September 23, 2006
Hello, you have nice site <a href="http://hometown.aol.com/shlyapa2/cellular-phone.html">Cellular">http://hometown.aol.com/shlyapa2/cellular-phone.html">Cellular Phone</a> [url=http://hometown.aol.com/shlyapa2/cellular-phone.html]Cellular Phone[/url] goodbye. - Anonymous
September 23, 2006
<a href="http://hometown.aol.com/shlyapa2/home_for_sale.html">Home">http://hometown.aol.com/shlyapa2/home_for_sale.html">Home for Sale</a> [url=http://hometown.aol.com/shlyapa2/home_for_sale.html]Home for Sale[/url] - Anonymous
September 23, 2006
<a href="http://hometown.aol.com/shlyapa2/home_for_sale.html">Home">http://hometown.aol.com/shlyapa2/home_for_sale.html">Home for Sale</a> [url=http://hometown.aol.com/shlyapa2/home_for_sale.html]Home for Sale[/url] - Anonymous
September 23, 2006
<a href="http://hometown.aol.com/shlyapa2/home_for_sale.html">Home">http://hometown.aol.com/shlyapa2/home_for_sale.html">Home for Sale</a> [url=http://hometown.aol.com/shlyapa2/home_for_sale.html]Home for Sale[/url] - Anonymous
September 24, 2006
Nice site <a href="http://car-insurance-p4zw.blogspot.com">Car">http://car-insurance-p4zw.blogspot.com">Car Insurance</a> [url=http://car-insurance-p4zw.blogspot.com]Car Insurance[/url] sorry. - Anonymous
September 24, 2006
Nice site <a href="http://car-insurance-p4zw.blogspot.com">Car">http://car-insurance-p4zw.blogspot.com">Car Insurance</a> [url=http://car-insurance-p4zw.blogspot.com]Car Insurance[/url] sorry. - Anonymous
September 26, 2006
Good site <a href="http://car-insurance-0.blogspot.com/">Car">http://car-insurance-0.blogspot.com/">Car Insurance</a> [url=http://car-insurance-0.blogspot.com/]Car Insurance[/url] bye. - Anonymous
September 26, 2006
Thanks for the great tips about <a href="http://business.net4free.org/JhonLocke/endowment-mortgage.html"">http://business.net4free.org/JhonLocke/endowment-mortgage.html" title="endowment mortgage">endowment mortgage</a> and [URL=http://business.net4free.org/JhonLocke/endowment-mortgage.html]endowment mortgage[/URL] - Anonymous
September 27, 2006
Good site! - Anonymous
September 28, 2006
Very informative post about <a href="http://eteamz.active.com/personalloan/files/apartment-in-barcelona.html"">http://eteamz.active.com/personalloan/files/apartment-in-barcelona.html" title="apartment in barcelona">apartment in barcelona</a> and [URL=http://eteamz.active.com/personalloan/files/apartment-in-barcelona.html]apartment in barcelona[/URL] - Anonymous
September 29, 2006
Thank you so much for this great post about <a href="http://osgooddevine.bravehost.com/biox.html"">http://osgooddevine.bravehost.com/biox.html" title="biox">biox</a> and [URL=http://osgooddevine.bravehost.com/biox.html]biox[/URL] - Anonymous
September 30, 2006
Amazing site, useful <a href="http://parishilton-paris.blogspot.com/ ">Paris Hilton</a> [url=http://parishilton-paris.blogspot.com/]Paris Hilton[/ur] bye! - Anonymous
September 30, 2006
Greatest site <a href="http://parishilton-paris.blogspot.com/ ">Paris Hilton</a> [url=http://parishilton-paris.blogspot.com/]Paris Hilton[/ur] goodbye! - Anonymous
October 01, 2006
Very good site <a href="http://car-insurance-.blogspot.com/ ">Car Insurance</a> [url=http://car-insurance-.blogspot.com/]Car Insurance[/ur] goodbye! - Anonymous
October 01, 2006
The comment has been removed