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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annoying Date Problem!

Status
Not open for further replies.
May 9, 2000
446
GB
Hi, I've got a screen where users have to change their password. Basically after 30 or so days they're shown this screen and told to enter a new password and then the 30 days starts again. The problem is dead simple i'm sure but I can't think of how to srt it out! Basically the date is coming into my access database and showing on the web page in the format mm/dd/yyyy whereas I want it to be in the format dd/mm/yyyy. I've looked at the regional settings on the server etc....

Any help would be great!
 
??
are you jsut looking for if DateDiff("d", rs.start, now())= 30 [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
Open your access database (with MS Access) right click your table that contains a date and select design table.
Clic on your field name and click on the General tab in the bottom.
For format you can fil in mm/dd/yyyy or dd/mm/yyyy or mmmm/dd/yyyy.
Now the date that comes out the access database is in the format you want it to be.
As vb script (asp) has to do with your regional settings (I think) you should set this the same as your access database and you can easily calculate the difference like so:
if now() - rs("date") > 30 then
....
 
Hey cheers for the responses, have used Day(DATE) & "/" & month(date) & "/" & year(date). Tried changing the date format in access but it was still showing up wrong.... wierd!
 
I had a similar problem.

Access and regional date settings were in the format dd/mm/yyyy. When using ASP the date was returned in the format mm/dd/yyyy. I'm using an american server, hence the date format.

Including the line

<%Session.LCID = 2057%>

at the begining of the asp File immediately after <html> and before <head> sorted the formatting
 
Thank you ttmac, I wil remember this one (put it in my know how DB).
I notesed that in VB the date is mm-dd-yyy even if I have my regional settings to dd-mm-yyyy.
Dim mydata As Date
mydate = #1/2/2002#
MsgBox Day(mydate)
This gives me a 2.

I post this on VB forum to see what causes this.
We are using US date style so it is no problem but I allways thought the date is detemaned by the regional settings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top