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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:17:18+00:00 2026-05-14T04:17:18+00:00

I am looking for a function to reverse any string ( YYYYMDD , YY/MM/DD

  • 0

I am looking for a function to reverse any string (YYYYMDD,YY/MM/DD,YYMMDD,…) created by the function FormatDateTime to datetime.

example

I have a string-date in format YYYYMMDDcreated by FormatDateTime

mydatestr:=FormatDateTime('YYYYMMDD',Mydate); 

now how I can convert mydatestr to DateTime again?

UPDATE

these functions

function StrToDate(const S: string): TDateTime; overload;
function StrToDate(const S: string;
  const FormatSettings: TFormatSettings): TDateTime; overload;

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

do not support passing a string with the format to convert.

I am looking something like this

Mydatetime:=InvFormatDatetime('20091225','yyyymmdd');

or

Mydatetime:=InvFormatDatetime('20090108','yyyyddmm');
  • 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-14T04:17:18+00:00Added an answer on May 14, 2026 at 4:17 am

    It is quite easy with existing solution, StrToDateFmt function in rxDateutil.pas unit from RX package, which can be downloaded here: http://sourceforge.net/projects/rxlib/

    EDIT:

    Mentioned above function and StrToDateFmt from rxDateutil.pas are doing exactly what you expect, converting string to datetime using specified string mask, the code is too large to be included as this unit contains also other date functions, some of them required for converting string to date.

    Example of use:

    Result := StrToDateFmtDef('MM/DD/YYYY', '11/11/2011', Now);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a method (or function) to strip out the example.ext part of
I am looking to write a function like ref String TestIt( int index )
I'me looking for a function that would receive a time and would round it
Original Question I am looking for a function that attempts to quantify how distant
I am not that familiar with Javascript, and am looking for the function that
Looking for a nifty helper function/method for grepping through all defined tables, columns, stored
I'm looking for a PHP library/function/class which can create Identicon s.
I'm looking for an AJAX function to dynamically request an HTML page. I already
I'm looking to implement a function that retrieves a single frame from an input
I am looking for a way to get a function in excel to retrieve

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.