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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:12:29+00:00 2026-05-26T10:12:29+00:00

Using the RTTI system in Delphi 2010, is there any way to find out

  • 0

Using the RTTI system in Delphi 2010, is there any way to find out if a property is a TDateTime? It’s currently treating it as a double whenever I call back asVariant and also if I check the property type. Is this due to the fact it can only see the base type? (TDateTime = double)

  • 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-26T10:12:29+00:00Added an answer on May 26, 2026 at 10:12 am

    Try checking the Name property of the TRttiProperty.PropertyType

    I don’t have Delphi 2010, but this works in XE.

    {$APPTYPE CONSOLE}
    
    uses
      SysUtils,
      Classes,
      Rtti;
    
    type
      TMyClass =class
      private
        FDate: TDateTime;
        FProp: Integer;
        FDate2: TDateTime;
        FDate1: TDateTime;
      public
       property Date1 : TDateTime read FDate1  Write FDate1;
       property Prop : Integer read FProp  Write FProp;
       property Date2 : TDateTime read FDate2  Write FDate2;
      end;
    
    var
     ctx : TRttiContext;
     t :  TRttiType;
     p :  TRttiProperty;
    begin
     ctx := TRttiContext.Create;
     try
       t := ctx.GetType(TMyClass.ClassInfo);
       for p in  t.GetProperties do
        if CompareText('TDateTime',p.PropertyType.Name)=0 then
         Writeln(Format('the property %s is %s',[p.Name,p.PropertyType.Name]));
     finally
       ctx.Free;
     end;
      Readln;
    end.
    

    this code returns

    the property Date1 is TDateTime
    the property Date2 is TDateTime
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's a good way to serialize a Delphi object tree to XML--using RTTI and
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
For example, is there a way to find out that this class has a
Using online interfaces to a version control system is a nice way to have
As already discussed in Rtti data manipulation and consistency in Delphi 2010 a consistency
Using Tsql, how can I find out when MS SQL server was installed?
I want to serialize an Object in Delphi and I'm using the new RTTI.
I'm using Visual Studio and performing a valid dynamic cast. RTTI is enabled. Edit
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the

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.