Windows Vista Tips

Windows Vista Tips > Newsgroups > Internet Explorer > Inconsistent date display

Reply
Thread Tools Display Modes

Inconsistent date display

 
 
.Len B
Guest
Posts: n/a

 
      12-29-2009
I have partial responsibility for a website. On a particular page dates
must be displayed. The data is drawn from a backend access database using
vbscript.

<%=(Recordset1.Fields.Item("News_Date").Value)%>

On some computers the date displays in US format, mm/dd/yy and on others
I see dd/mm/yy. In all cases, Regional Settings are set to
English(Australia) and Location=Australia. Short Date shows as 29-Dec-09.
In unrelated access databases, dates show correctly if the texbox format
is blank or set to ShortDate.

Any ideas on -
why the display is inconsistent or
how to force a consistent display based on RegionalSettings.

TIA
--
Len
__________________________________________________ ____
remove nothing for valid email address.


 
Reply With Quote
 
 
 
 
PA Bear [MS MVP]
Guest
Posts: n/a

 
      12-29-2009
Developer-specific resources include:

MSDN IE Development Forums <=post such questions here instead
http://social.msdn.microsoft.com/for...iedevelopment/

IE Developer Center
http://msdn.microsoft.com/en-us/ie/default.aspx

Learn IE8
http://msdn.microsoft.com/en-us/ie/aa740473.aspx

HTML and DHTML Overviews and Tutorials
http://msdn.microsoft.com/en-us/library/ms537623.aspx and

Cascading Style Sheets (CSS)
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
debugging tool for IE6, IE7, and IE8)
http://www.microsoft.com/downloads/d...b-dccff3fae677

Expression Web SuperPreview Release Notes
http://www.microsoft.com/expression/...easeNotes.aspx

Validators:
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/


..Len B wrote:
> I have partial responsibility for a website. On a particular page dates
> must be displayed. The data is drawn from a backend access database using
> vbscript.
>
> <%=(Recordset1.Fields.Item("News_Date").Value)%>
>
> On some computers the date displays in US format, mm/dd/yy and on others
> I see dd/mm/yy. In all cases, Regional Settings are set to
> English(Australia) and Location=Australia. Short Date shows as 29-Dec-09.
> In unrelated access databases, dates show correctly if the texbox format
> is blank or set to ShortDate.
>
> Any ideas on -
> why the display is inconsistent or
> how to force a consistent display based on RegionalSettings.
>
> TIA


 
Reply With Quote
 
Dan
Guest
Posts: n/a

 
      12-30-2009

".Len B" <> wrote in message
news:...
> I have partial responsibility for a website. On a particular page dates
> must be displayed. The data is drawn from a backend access database using
> vbscript.
>
> <%=(Recordset1.Fields.Item("News_Date").Value)%>
>
> On some computers the date displays in US format, mm/dd/yy and on others
> I see dd/mm/yy. In all cases, Regional Settings are set to
> English(Australia) and Location=Australia. Short Date shows as 29-Dec-09.
> In unrelated access databases, dates show correctly if the texbox format
> is blank or set to ShortDate.
>
> Any ideas on -
> why the display is inconsistent or
> how to force a consistent display based on RegionalSettings.
>



Your use of <%= suggests that you are using ASP on the server. Are you sure
the format changes from computer to computer? As the code is running on the
web server it should be consistent, unless you are also using windows
authentication and there are differing regional settings on the web server
for these user accounts (if the server is part of an ADS configuration then
you'll need to change the user account regional settings in ADS). Localised
regional settings on the computers are irrelevant here - it's the server
that is turning the date data into a string and placing it in the web page.

If you are happy to force the date format no matter what the browser
settings might be, then you can simply write a function to fix the date
format no matter what the regional settings of the web server user account
are. For this you can use the Session.LCID property, which will force the
locale for the rendering of the web page at the server side, eg. at the top
of the ASP source add

<% Session.LCID = 2057 %>

to force dd/mm/yyyy format (2057 is UK English), or 1033 for mm/dd/yyyy
format (this is the General Unicode locale which uses US date formatting).

You may have better luck posting in a newsgroup specific for the platform -
assuming Classic ASP (as opposed to ASP.NET) on IIS try
microsoft.public.asp.general , microsoft.public.asp.db , or
microsoft.public.inetserver.iis

--
Dan

 
Reply With Quote
 
.Len B
Guest
Posts: n/a

 
      12-30-2009
"Dan" <> wrote in message
newsB165EFE-EBC0-4567-A8BE-...
|
| ".Len B" <> wrote in message
| news:...
| > I have partial responsibility for a website. On a particular page
dates
| > must be displayed. The data is drawn from a backend access database
using
| > vbscript.
| >
| > <%=(Recordset1.Fields.Item("News_Date").Value)%>
| >
| > On some computers the date displays in US format, mm/dd/yy and on
others
| > I see dd/mm/yy. In all cases, Regional Settings are set to
| > English(Australia) and Location=Australia. Short Date shows as
29-Dec-09.
| > In unrelated access databases, dates show correctly if the texbox
format
| > is blank or set to ShortDate.
| >
| > Any ideas on -
| > why the display is inconsistent or
| > how to force a consistent display based on RegionalSettings.
| >
|
|
| Your use of <%= suggests that you are using ASP on the server. Are you
sure
| the format changes from computer to computer? As the code is running on
the
| web server it should be consistent, unless you are also using windows
| authentication and there are differing regional settings on the web
server
| for these user accounts (if the server is part of an ADS configuration
then
| you'll need to change the user account regional settings in ADS).
Localised
| regional settings on the computers are irrelevant here - it's the
server
| that is turning the date data into a string and placing it in the web
page.
|
| If you are happy to force the date format no matter what the browser
| settings might be, then you can simply write a function to fix the date
| format no matter what the regional settings of the web server user
account
| are. For this you can use the Session.LCID property, which will force
the
| locale for the rendering of the web page at the server side, eg. at the
top
| of the ASP source add
|
| <% Session.LCID = 2057 %>
|
| to force dd/mm/yyyy format (2057 is UK English), or 1033 for mm/dd/yyyy
| format (this is the General Unicode locale which uses US date
formatting).
|
| You may have better luck posting in a newsgroup specific for the
platform -
| assuming Classic ASP (as opposed to ASP.NET) on IIS try
| microsoft.public.asp.general , microsoft.public.asp.db , or
| microsoft.public.inetserver.iis
|
| --
| Dan
|

Thanks Dan, very helpful.
Yes, straight ASP. All clients GMT+10 but different client locations
spread by probably 40 miles, web server in Boston.

I must admit that PA Bear's response confused me in that he was implying
a coding problem. Regardless of poor coding, I expected that the server
would have to be delivering consistent content to all the machines,
either always 'wrong' or always 'right', and despite that, different
versions of IE (6 & 8) on 4 different boxes were displaying different
date content. ??? That's why I asked here rather than in a dev ng.

In writing this reply I think the answer has popped into my head. IIRC,
one of the boxes was the development server running its own local web
server and one of the tests was probably done 'locally' thus delivering
the 'correct' answer. D'oh!

Thanks guys.
--
Len
__________________________________________________ ____
remove nothing for valid email address.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
virtual Display driver in vista harry30 Windows Vista Drivers 0 11-24-2009 05:48 AM
display document creation date Norman Windows Vista File Management 1 11-19-2007 09:33 PM
Dual display set-up doesn't work on Win2000 or Vista JanneL Windows Vista Hardware 2 10-12-2007 02:29 PM
Radeon X1300 Display not visible after HDTV source switch or power cycle Jim Lawson Windows Vista Hardware 0 03-11-2007 02:46 PM
NVidia GeForce 7300GS and RC2 Dual display - very odd Stuart Windows Vista Hardware 1 11-07-2006 12:38 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59