Date problem

H

hugh welford

Hi,

I am in UK, running access 2000 + IIS4 + VISTA Ultimate in offline
environment - i.e. webserver installed on my machine and not connected to
internet, on a machine set up for UK.

I have an access 2000 database field storing dates in medium date format
01-Oct-09 which is what I want.

I access this field to populate a pulldown menu and it is displayed as UK
format 01/10/09 which is not quite what I want but will do.

I also access this field to populate a text box and it displays as US format
10/01/09 which is not at all what I want and not OK.

What goes on??? Why dont these 2 form objects display in the same format as
set up for the data base? Do I have to define date formats on each webpage?
And if so, how do I do it?

Help, please - how do I achieve consistency - must absolutely be able to
trust dates.

Thanks in advance
Hugh
 
B

Bob Barrows

hugh said:
Hi,

I am in UK, running access 2000 + IIS4 + VISTA Ultimate in offline
environment - i.e. webserver installed on my machine and not
connected to internet, on a machine set up for UK.

I have an access 2000 database field storing dates in medium date
format 01-Oct-09 which is what I want.

Dates are NOT stored with any format. They are stored (in Jet) as Doubles,
with the whole number portion containing the number of days since the seed
date, and the decimal portion containing the time of day. The Format
property you set in the Access Table Design window is an Access-specific
property that only controls how _Access_ will display the date values
retrieved from that field. It has nothing to do with how the values are
stored, and has no effect whatsoever on how other applications will display
the date values retrieved from that field.
I access this field to populate a pulldown menu and it is displayed
as UK format 01/10/09 which is not quite what I want but will do.

Dropdowns are implemented in IE using a Windows control, so your Regional
settings are being used to format the date values.
I also access this field to populate a text box and it displays as US
format 10/01/09 which is not at all what I want and not OK.

Values in text inputs are direct writes from Response, so the Regional
settings on the server are controlling the format (the default Regional
setting for MS OS is US.
What goes on??? Why dont these 2 form objects display in the same
format as set up for the data base? Do I have to define date formats
on each webpage? And if so, how do I do it?

Yes, you do need to format the values being retrieved from that field in the
format you want before writing them to Response. See:
http://classicasp.aspfaq.com/date-t.../can-i-make-vbscript-format-dates-for-me.html

More info in these articles:
http://classicasp.aspfaq.com/date-t...ion/could-i-get-a-little-help-with-dates.html
http://databases.aspfaq.com/general...yy-dd/mm/yyyy-confusion-once-and-for-all.html
 
H

hugh welford

Thanks bob.

Hugh


Bob Barrows said:
Dates are NOT stored with any format. They are stored (in Jet) as Doubles,
with the whole number portion containing the number of days since the seed
date, and the decimal portion containing the time of day. The Format
property you set in the Access Table Design window is an Access-specific
property that only controls how _Access_ will display the date values
retrieved from that field. It has nothing to do with how the values are
stored, and has no effect whatsoever on how other applications will
display the date values retrieved from that field.


Dropdowns are implemented in IE using a Windows control, so your Regional
settings are being used to format the date values.


Values in text inputs are direct writes from Response, so the Regional
settings on the server are controlling the format (the default Regional
setting for MS OS is US.


Yes, you do need to format the values being retrieved from that field in
the format you want before writing them to Response. See:
http://classicasp.aspfaq.com/date-t.../can-i-make-vbscript-format-dates-for-me.html

More info in these articles:
http://classicasp.aspfaq.com/date-t...ion/could-i-get-a-little-help-with-dates.html
http://databases.aspfaq.com/general...yy-dd/mm/yyyy-confusion-once-and-for-all.html

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top