Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Jahren
Letzter Beitrag:
vor 9 Jahren
Beteiligte Autoren:
Dan M, Dan, Al, Jimbo

Date formatting issues ...

Startbeitrag von Dan M am 18.06.2009 06:46

Can someone point me in the right direction date formatting ...

I know it has something to do with the INPUT MASK and RETURN VALUE but I am not seeing where I am going wrong.

The data file/table is MySQL so standard format is YYYY-MM-DD

I would to display as MM/DD/YY (basic American)

When I enter 06/10/09 it saves as 2009-01-00 in the MySQL table and when I open the form up again it displays as __/10/09

Any help is appreciated ...



Hello Dan

I have not dealt with MySQL but in the Hyper Files the standard return mask is yyyymmdd. If the return mask is left at "As Is" then you will often see problems like you are reporting.

In terms of the display mask on the form you can nominate a mask MM/DD/YY or let it default to the "Date Defined by Project" if you use that mask then check the settings in the Project description > Languages section


von Al - am 18.06.2009 09:30

Re: Date formatting issues ... Still trying ...

I am using MySQL as a database. Dates are stored as YYYY-MM-DD.

What should I be using for the Input Mask and Returned Value and where do I need to make sure it is correct?

such as ...
1. Analysis > Table > Date field > Parameters of the control Linked to the selected item

2. In the control on each screen > Desctiption of the control

Other than in the Analysis and the Description of the control ... Is there any where else I need to make sure the date formatting is correct?

von Dan M - am 21.06.2009 16:34

Re: Date formatting issues ... Still trying ...

Hm, did you change the display format of the date in the control ?????

von Jimbo - am 21.06.2009 16:42
I believe so ... (in WinDev12)

I did this by going to the actual form, then right click on the control , and there you see Input Mask & Returned Value.

Is that what you mean?

I am using MM/DD/YY in the Input Mask and YYYYMMDD in the returned value.

I thought I should use YYYY-MM-DD in the Returned value (since that is the format in the MySQL table) but that seems to give odd results including mixed up numbers, blanks in the date, etc ...

When I changed the returned value to YYYYMMDD and the MM/DD/YY then I was at least displaying the same date that was stored in the MySQL table to the table and form as MM/DD?YY. BUT when I attempt to modify the date in the form by entering 06/23/09 it will not allow. As I type 06/23/09, 06 is fine, when I type 23 it displays 02/3 the 3 being in the year section so it looks like 06/02/3 I can then change the 3 to 09 but I cannot enter 23 in the middle section for the day.

I can type 01 thru 12 in the middle section.

I think I am confused on the "returned value" part what am I supposedto have there ?? Because where the display shows the correct date 05/12/09 and then I type over the it with 06/23/09 it seems to be accepting input of the month field where I think the day should go ??

When I read the help screen I don't think I am getting what I am supposed put in the Returned Vlaue field??

von Dan - am 21.06.2009 17:09
Well after several hours of trying many combinations of the two different date formats I have identified what works but have no understanding of why or the logic behind it ...

All I can say is this works ...

If you are using MySQL as your database which stores dates as YYYY-MM-DD (example 2009-06-21) then you should use:

YYYYMMDD as your Returned Value (this needs to be set in the Analysis > Table > Parameters & the window control > Description

Then, set what ever format you want for how it displays in the Input Mask

I am using MM/DD/YY to display as 06/21/09

Hope this save someone else the many hours it took me to figure it out!

von Dan M - am 21.06.2009 22:22
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.