| Author |
Topic Search Topic Options
|
BoLt
Senior Member
Joined: 20 November 2003
Location: United Kingdom
Status: Offline
Points: 285
|
Post Options
Thanks(0)
Quote Reply
Topic: Date to Database file Mess up !!! HELP! Posted: 05 January 2004 at 4:40pm |
I don’t know if you can help me on this one.
I am saving a date to a database file, Month/Day/Year TIME Eg, 06/03/04 01:05:00 . If I save to a database file in the range of 1 to 12 Day's the Day and Month reverses. This is ok for the range 13 to 31 days.
Eg, Date and time of 06/03/04 01:05:00 Reverses round to be 03/06/04 01:05:00
Is this something to do with the way the host server see’s the date and saves it to the file
If so how can I stop it?
Or
Is this somthig else? 
|
|
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.
www.welshlens.co.uk
|
 |
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2004 at 12:41am |
I'm afraid that Access and SQL server sometimes get confused by dates... I don't know for sure where they loose it, but the best thing is to create a function and insert dates in a safely way, like
<% safedate = DatePart("yyyy", Date) &"-"& DatePart("m", Date) &"-"&DatePart("d", Date) %>
|
or sothing similar and pull the dates out the same way...
|
|
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2004 at 1:03am |
|
sql always uses US dates from what i know.
|
 |
BoLt
Senior Member
Joined: 20 November 2003
Location: United Kingdom
Status: Offline
Points: 285
|
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2004 at 5:52am |
Thakz for your help I will give it a go.

|
|
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.
www.welshlens.co.uk
|
 |
psycotik
Groupie
Joined: 27 November 2003
Status: Offline
Points: 73
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2004 at 12:25am |
Always when you use dates put it in yyyy-mm-dd format. In asp and sql. That way there is never any doubt as to which format its in.
Sometimes you might change webhosts and have to recode alot of files just to fix it, so its better to be safe from the start.
|
 |
BoLt
Senior Member
Joined: 20 November 2003
Location: United Kingdom
Status: Offline
Points: 285
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2004 at 3:19pm |
psycotik wrote:
Always when you use dates put it in yyyy-mm-dd format. In asp and sql. That way there is never any doubt as to which format its in.
Sometimes you might change webhosts and have to recode alot of files just to fix it, so its better to be safe from the start.
|
I had a feeling it had to be done in a strange format to stop the host from swopping the info around Thankz. I have got round the problem for now as I don’t wish to change all the code around by telling it to swop the data entered between 1 & 12 with the month and day. That has don the trick for now but next time I will do the format as you have described Thank you.
Edited by BoLt
|
|
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.
www.welshlens.co.uk
|
 |
theSCIENTIST
Senior Member
Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 January 2004 at 3:10pm |
|
Alternatevly you could do it my way, stop worring about which date/time format the DB holds it, and sort it by the time you call your data, ie. myDate = Year(strYear) & "/" & Month(strMonth) and so on. This way you can display date/time in the format you want.
|
 |