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

  • SEARCH
  • Home
  • 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 1041465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:21:25+00:00 2026-05-16T15:21:25+00:00

Is there an equivalent in Delphi? I’ve looked over the documentation and can’t find

  • 0

Is there an equivalent in Delphi? I’ve looked over the documentation and can’t find anything that would give me the output I want.

  • 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-16T15:21:26+00:00Added an answer on May 16, 2026 at 3:21 pm

    kdunlapmo, the DateTime.ToString(“s”) function return an Sortable date/time pattern; conforms to ISO 8601. this pattern is declarated as "yyyy-MM-ddTHH:mm:ss". regardless of the culture, the date must always be returned in the same format. you can use the FormatDateTime function in delphi to format an TDateTime value into a string.

    you can use something like this

    FormatDateTime('yyyy-mm-dd"T"hh:mm:ss', Now);
    

    but you must be careful because the - character is Substituted by the DateSeparator value and the : character is Substituted by the TimeSeparator value, both variables are depending on the Windows locale configuration. so to avoid problems getting distinct results when the culture changes you must use explicity the - and the : characters in your format string.

    FormatDateTime('yyyy"-"mm"-"dd"T"hh":"mm":"ss', Now)
    

    see this sample code

    program ProjectTestFormat;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils;
    
    begin
      try        
        DateSeparator:='/';
        TimeSeparator:='.';
        //this string is affected by the windows locale configuration
        Writeln(FormatDateTime('yyyy-mm-dd"T"hh:mm:ss', Now));
        //this string is not affected
        Writeln(FormatDateTime('yyyy"-"mm"-"dd"T"hh":"mm":"ss', Now));
        Readln;
      except
        on E:Exception do
          Writeln(E.Classname, ': ', E.Message);
      end;
    end.
    

    Additionally you can write a function to convert an TDatetime value to the sortable format, see this sample

    function GetSortableDatetimeFormat(Value:TDateTime):string;
    begin
      Result:=FormatDateTime('yyyy"-"mm"-"dd"T"hh":"mm":"ss', Value);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a Delphi equivalent of the C utoa function, that allows me to
I'm trying to figure out if there's anything in QT that is equivalent to
Is there a Java Swing component equivalent to Delphi's TDBCtrlGrid ? Or can the
Is there an equivalent of Apache log4cxx that can be embedded in a distributed
Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?
Is there an equivalent to Apache's VirtualHost for IIS? We want to be able
Is there a Delphi equivalent of this .net's method: Url.UrlEncode() Note I haven't worked
In Delphi, how can you use try, finally, and catch together? A Java/C# equivalent
Is there any equivalent to Collections.getOnlyElement() that works with arrays? I'm aware it's a
Is there an equivalent for Interlocked.Exchange for boolean? Such as an atomic exchange of

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.