Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates

Status
Not open for further replies.

harrysdad

Programmer
Joined
May 30, 2002
Messages
53
Location
GB
I have dates stored as 26/01/2004 in an access database, and also times stored as 09:00 AM; but when returned on an asp page they appear as 01/26/2004 and 9:00:00 AM.

Why does this happen and how do I get around it?

Regards,

Tony
 
There may be some code that sorts this but in the past i found i had to change the time and date settings on the server hosting the site.

You could sqeeze each part of the date into different variables by using year(dateVar), month(dateVar) and i think its day(dateVar) and display them on the page as you want them but this is rather long winded as you may find.

If thats the best way you could create a sub to call and return this.

Cheers.

**Lock up your daughters..... we're going to town!**
 
>There may be some code that sorts this but in the past i found i had to change the time and date settings on the server hosting the site.

Well, that was my original gambit, but strangely the settings on the server appear to be correct, hence my puzzlement!
 
Which settings did you check, looking back i think it may be the settings on your sql server, we had to have ours continuously logged in as if it was logged out of a user it then defaults back to american-esque dates. (if not the sql then the WebServer! one of the two.)

Just looking at creating a simple sub so all you need to do is call it, but this may mess up the data if it were updated back to the server.

Cheers.

**Lock up your daughters..... we're going to town!**
 
Interestingly, when I converted an Access query to an asp page, the dates appeared correctly - for no obvious reason. This means that in future, rather than creating asp pages in Dreamweaver, I might just knock up access queries and export them as asp files! I find that this way you can also write more complex queries that Dreamweaver MX 2004 doesn't seem able to cope with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top