date format on a web page

  • Thread starter Thread starter TB
  • Start date Start date
T

TB

How do I change the date format of database result field on a web page?

The data is stored in my access file as "dd/mm/yy" (the way I prefer), but
the date fields are displayed on the web as "mm/dd/yy".

Thanks in advance for your help.

Trym
 
Hi,

I understand that you would like to change the date format for Database
Wizard Results page. Based on my experience, one possible soltuion is to
change the regional settings on the server side.

Generally, we would need custom scripting and coding. For example:

1. On a blank page in FrontPage, click the Insert menu, point to Database,
and then click Results.

2. Click the button for the sample database connection (Northwind).

3. Click Next.

4. For the record source, click Orders, and then click Next.

5. Click Edit List, and remove all Displayed Fields except for Order Date.

6. Click OK in the Displayed Fields dialog box, and then click Next twice.

7. Click Finish.

8. In Normal view in FrontPage, click the <<OrderDate>> entry, and then
click Delete.

9. With the insertion point still placed in the cell where the
<<OrderDate>> was deleted, switch to HTML view.

10. Insert the following code where the insertion point is positioned:

<%=MonthName(Month(FP_FieldVal(fp_rs,"OrderDate"))) & " " &
Day(FP_FieldVal(fp_rs,"OrderDate"))%>

11. Save the page as Date.asp, and preview it in the browser. The OrderDate
field is displayed in the mmmm dd (March 15) format.

As this issue is dev-related, I would suggest you submit a post on the
developer newsgroup for further assistance. The developer newsgroups are
located at: http://msdn.microsoft.com/newsgroups/default.asp.

Sincerely,

Arnold Gao

Microsoft Online Partner Support


Get Secure! - www.microsoft.com/security

====================================================
When responding to posts, please "Reply to Group" via
your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and
confers no rights.
 
Thanks for your help, which have taught me how to express a date with
letters.

Meanwhile, I have also found very simple way to change the way dates are
shown on a web: the property LCID.

For example: <% Session.LCID=1034 %> means that dates are shown in Spanish -
Traditional sort (used in Spain). As a result, August 5 2004 is shown as
"05/08/2004". Combing your code and the above-mentioned property in the
following manner:

<% Session.LCID=1034 %>
<%=Day(FP_FieldVal(fp_rs,"Date")) & " de " &
MonthName(Month(FP_FieldVal(fp_rs,"Date"))) & " " &
Year(FP_FieldVal(fp_rs,"Date"))%>

the date would be shown as "5 de agosto 2004" - the correct way to say the
date in Spanish ("agosto" is "August" in Spanish.

Trym
 
Hi,

It's nice to see you have found the solution. Thanks for sharing it here. :)

Sincerely,

Arnold Gao

Microsoft Online Partner Support


Get Secure! - www.microsoft.com/security

====================================================
When responding to posts, please "Reply to Group" via
your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and
confers no rights.
 
Back
Top