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 952751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:56:41+00:00 2026-05-15T23:56:41+00:00

In my code I am facing a problem. Example code: var d1: tdatetime begin

  • 0

In my code I am facing a problem. Example code:

var 
    d1: tdatetime
begin
    d1 := strtodatetime('23/02/2011 12:34:56');
end; 

but it’s giving the error:

’23/02/2011 12:34:56′ is not valid
date and time

What’s wrong with what I am doing?

  • 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-05-15T23:56:42+00:00Added an answer on May 15, 2026 at 11:56 pm

    the StrToDateTime function uses the ShortDateFormat and DateSeparator to convert the date part and the LongTimeFormat and TimeSeparator to the time part. so you string must match with theses variables to convert the string to TDateTime. instead you can use the StrToDateTime with the TFormatSettings parameter, to parse you string.

     function StrToDateTime(const S: string; const FormatSettings: TFormatSettings): TDateTime; 
    

    check this sample

    Var
    StrDate : string;
    Fmt     : TFormatSettings;
    dt      : TDateTime;
    begin
    fmt.ShortDateFormat:='dd/mm/yyyy';
    fmt.DateSeparator  :='/';
    fmt.LongTimeFormat :='hh:nn:ss';
    fmt.TimeSeparator  :=':';
    StrDate:='23/02/2011 12:34:56';
    dt:=StrToDateTime(StrDate,Fmt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am facing the problem tapping on the table view my code was not
I'm trying to implement PLINQ example but facing following problem My sequential queries are
Iam facing problem in understanding and converting a matlab code into opencv. I want
iam facing problem in passing array to view. this is my controller code.. function
i am using mvc 3 code first. facing problem while passing data form SecurityAttribute
I am facing a problem with EF Code First with TPH. I am getting
I am facing a problem with urllib.url_encode in python. Bets explained with some code:
I'm currently facing new problem with operators. Using following code, I want to make
Hi I am facing a problem in Message dialog, getting Force close my code
hi im new to jquery and im facing these problem i have these code

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.