Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8236569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:10:34+00:00 2026-06-07T19:10:34+00:00

Who can to advice in my problem. I set date format as ‘JUL/12 –

  • 0

Who can to advice in my problem.
I set date format as ‘JUL/12 – 12 15:35’, but when using StrToDateTime then give EConvertError.

What can I do with this format which contains 2 – date separator ?


Use next code

    function LocaleFormatStrToDateTime(const S: string): TDateTime;
        var
          LFormatSettings: TFormatSettings;
        begin
          LFormatSettings := GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT);
          LFormatSettings.ShortTimeFormat := FormatSettings.ShortTimeFormat;
          LFormatSettings.TimeSeparator := FormatSettings.TimeSeparator;
          Result := StrToDateTime(S, LFormatSettings);
        end;


----------

**

the best solution is use jvDateUtil.StrToDate*

**

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:10:36+00:00Added an answer on June 7, 2026 at 7:10 pm

    Probably the string you’re trying to convert is not compatible with the default system format. Taking a look at the method signature and description reveals that you can override it to suit your needs, see an example here.

    It would be helpful if you posted a piece of the code you have so far, maybe you overlooked something.


    EDIT

    I’ve missed the fact that your’re using a complex format, including multiple separators for the date, which I’m not sure that are supported in delphi.

    I guess that in this case you could split your string into pieces and then encode them into a TDateTime. To convert your month name to a month number you can iterate through the LFormatSettings.ShortMonthNames array, something like:

      String longMonth:= copy(S, 0, 3);
      for i := Low(LFormatSettings.ShortMonthNames) to High(LFormatSettings.ShortMonthNames) do
          if SameText(longMonth, LFormatSettings.ShortMonthNames[i]) then begin
              shortMonth:=FormatFloat('00', i);
              Break;
          end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

who can give me a simple code , i want a simplest way to
Who can give me a link for the operator= of vector in MSDN? Why
Dear everybody who can help, I have this PHP > MongoDB problem, I want
Looking for some help and advice please from Super Guru MySQL/PHP pros who can
this is my 1st time posting here, so thanks to everyone who can give
Who can help me to translate this XML Schema pattern [0-9]+-([0-9]|K) to java regular
Who can help me with regular expression? I need to remove a part of
Who can help me make the following query work... Both tables have the fields
To anyone who can help, Thanks Okay, so I have a database holding a
Is there any one who can point me to a Rails 3.2 multilingual starter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.