favc4
Posts: 30
|
| Posted: 07/01/2006, 9:42 PM |
|
Hi there, I have a record form wich handles a date, I use Mexico's date format wich is dd/mm/yyyy H:nn AM/PM
so I do state clearly that date format within custom insert and custom update, both for the database field and the control; the issue is, for instance, i do use the timepicker, pick 02/07/2006 wich is July 2, 2006 and the datepicker returns this date correctly, as 02/07/2006, but then I do update my form and what? returns 07/02/2006 and everything recorgnizes it as february 7th, 2006! I mean everything to Calendar component, DatePicker, etc. the Project Setting within locales is ok, is set to shortdate format dd/mm/yyyy, and I am using WinXP SP2, with msjet 4 sp8 (MSOffice SP8) and running out of patience any help is really appreciated!
Thanks
cHUCk
_________________
Programming win32 and went crazy... |
 |
 |
WKempees
|
| Posted: 07/02/2006, 2:13 AM |
|
Chuck,
relax and sit back,
You will have to divide this poblem up in two main pieces.
You are using Mexican format, meaning in all user input/output you use your
format.
More importantly though, what format does your database expect.
That database setting you need to know and set correctly in Project Setting
Connections, for both local and server.
Database servers have a tendency (luckily) to use yyyy-mm-dd HH:mm:ss:S.
So onece you have established that, and set all parameters accordingly, then
you can worry about the
I/O side, that is set at Project Setting as well, Locales and Encoding,
Spanish, Mexican.
The you generate a default small application, using date fields and check
out the code.
Copy paste the toSQL ccsDate like statements to a Notepad, stick that on the
desktop and if you lose track, refer to that.
Hope this helps,
Walter
|
|
|
 |
robertmann
Posts: 109
|
| Posted: 07/03/2006, 12:08 AM |
|
Walter may be right. Access will also accept yyyy-mm-dd or yyyy/mm/dd and it is better to use that date format in CCS connection. You can display dd/mm/yyyy but insert yyyy/mm/dd.
_________________
Robert |
 |
 |
Paul Shearing
|
| Posted: 08/16/2006, 7:38 AM |
|
I agree. dates are a mess and a constant source of problems.
I have found that the best solution is to avoid ambiguous dates by using a date format that cannot be confused such as 01-Apr-2006. (You will have to substitute the correct three-letter abbreviations for your locale. I have only ever attempted this with UK formatted dates). Most databases, including Access, will recognise this date format (or similar such as Apr/01/2006). This eliminates the day/month confusion and only allows a single interpretation.
HTH
Paul
PS. IMHO the only sensible date formatting option is YYYYMMDD because it is the only one that allows direct sorting on the string representation.
|
|
|
 |
|