Raw Date to String

Posted on 2006-04-18
Last Modified: 2010-05-18
How to I change a raw date string:   '123908.123129387' (for instance) to a readable string   '01/05/2006'?
Question by:fbk2000
    LVL 10

    Accepted Solution

    ShowMessage(FormatDateTime('dd/mm/yyyy hh:nn:ss:zzz', StrToFloat('123908.123129387')))

    Regards Jacco
    LVL 10

    Expert Comment

    The operation depends on the setting of the global DecimalSeparator (which is set to the Windows default set in the configuration panel). So you might have to add the following to makle it work:

    procedure TForm1.Button1Click(Sender: TObject);
      lSav: Char;
      lSav := DecimalSeparator;
      DecimalSeparator := '.';
        ShowMessage(FormatDateTime('dd/mm/yyyy hh:nn:ss:zzz', StrToFloat('123908.123129387')));
        DecimalSeparator := lSav;

    Regards Jacco

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now