Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 12 total |
ShortDataFormat error |
Thu, Aug 30 2012 9:01 AM | Permanent Link |
Ronald | Hi,
In my OnCreate event I set the ShortDateFormat. procedure TForm1.Form1Create(Sender: TObject); begin FormatSettings.DateSeparator:='-'; FormatSettings.ShortDateFormat:='M-d-yyyy'; end; On start of the app I get the error: Error in the format string M-d-yyyy (Too many date components). Am I doing something wrong here? Greetings, Ronald |
Thu, Aug 30 2012 3:58 PM | Permanent Link |
William | "Ronald" wrote:
Hi, In my OnCreate event I set the ShortDateFormat. procedure TForm1.Form1Create(Sender: TObject); begin FormatSettings.DateSeparator:='-'; FormatSettings.ShortDateFormat:='M-d-yyyy'; end; On start of the app I get the error: Error in the format string M-d-yyyy (Too many date components). Am I doing something wrong here? Try this, to get a clue of what is happening: procedure TForm1.Form1Create(Sender: TObject); var s: string; begin FormatSettings.DateSeparator:='-'; s := FormatSettings.ShortDateFormat; Label1.Caption := s; FormatSettings.ShortDateFormat:= s; Application.Desktop.OnResize := DesktopResize; end; You will see that the string contains 'M/d/yyyy' (no hyphens) in spite of the setting to FormatSettings.DateSeparator. Bill |
Thu, Aug 30 2012 4:21 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ronald,
<< On start of the app I get the error: Error in the format string M-d-yyyy (Too many date components). >> I think it's a bug. I'll make sure that this is fixed in build 2. Thanks, Tim Young Elevate Software www.elevatesoft.com |
Thu, Aug 30 2012 4:41 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bill,
<< Try this, to get a clue of what is happening: >> Actually, Ronald is correct in that you have to specify the date separator *first*, and then you have to specify the ShortDateFormat. The problem is with the '-' sign being considered the start of a number by the parser, and I'll have a fix for this in build 2. Thanks, Tim Young Elevate Software www.elevatesoft.com |
Fri, Aug 31 2012 3:04 AM | Permanent Link |
Ronald | Thank you, all. Will wait for build 2.
"Tim Young [Elevate Software]" schreef in bericht news:6523DE1C-115B-4ACB-8BA2-756E1576DCEF@news.elevatesoft.com... Ronald, << On start of the app I get the error: Error in the format string M-d-yyyy (Too many date components). >> I think it's a bug. I'll make sure that this is fixed in build 2. Thanks, Tim Young Elevate Software www.elevatesoft.com |
Wed, Feb 12 2014 8:31 AM | Permanent Link |
Matthew Jones | Did this ever get fixed?
I'm getting the error with: FormatSettings.ShortDateFormat := 'yyyy-MM-dd'; (I'm seeking ISO formatted dates) /Matthew Jones/ |
Wed, Feb 12 2014 8:32 AM | Permanent Link |
Matthew Jones | 'yyyyMMdd' fails with "invalid y component".
/Matthew Jones/ |
Wed, Feb 12 2014 8:58 AM | Permanent Link |
Matthew Jones | The workaround is easy of course:
FormatSettings.ShortDateFormat := 'yyyy MM dd'; FormatSettings.DateSeparator := '-'; I guess the assignment of a string is quite complicated really. /Matthew Jones/ |
Wed, Feb 12 2014 9:09 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< Did this ever get fixed? >> Yes. << I'm getting the error with: >> If you're using a different date separator, then you need to set that *before* you try to set the date format using the different separator: FormatSettings.DateSeparator:='-'; FormatSettings.ShortDateFormat := 'yyyy-MM-dd'; Tim Young Elevate Software www.elevatesoft.com |
Wed, Feb 12 2014 9:11 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< 'yyyyMMdd' fails with "invalid y component". >> Dates *must* use a separator of some kind. Tim Young Elevate Software www.elevatesoft.com |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Thursday, April 18, 2024 at 10:42 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |