PC Review


Reply
Thread Tools Rate Thread

date format on a web page

 
 
TB
Guest
Posts: n/a
 
      12th Aug 2004
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


 
Reply With Quote
 
 
 
 
Arnold Gao [MSFT]
Guest
Posts: n/a
 
      13th Aug 2004
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.

 
Reply With Quote
 
TB
Guest
Posts: n/a
 
      14th Aug 2004
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

""Arnold Gao [MSFT]"" <v-(E-Mail Removed)> wrote in message
news:k$hF9%(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Arnold Gao [MSFT]
Guest
Posts: n/a
 
      16th Aug 2004
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting complex date format to normal date format in Excel BlackNarcissus Microsoft Excel Misc 0 28th Jul 2011 04:28 PM
change date format on cover page Hulda Microsoft Word Document Management 1 29th Apr 2009 03:22 PM
Word 07: Customising Title Page/Footer Date Format =?Utf-8?B?QWxpYXNhbHBoYQ==?= Microsoft Word Document Management 4 23rd Jul 2007 11:36 AM
Minor bug in date format on last run page. =?iso-8859-1?Q?S=F8ren_Jespersen?= Spyware Announcements 1 6th Jan 2005 10:46 PM
Date format display in ASP page for NT 4.0 v/s Win2K =?Utf-8?B?SW10aWF6?= Microsoft Windows 2000 0 15th Dec 2004 06:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:17 PM.