Use VarToDateTime instead. It supports many more date formats in the string and converts them automatically.
var
DateVal: TDateTime;
begin
DateVal := VarToDateTime('23 Sep 2010');
ShowMessage(DateToStr(DateVal));
end;
I see you’re using Delphi 5. Some versions of Delphi will need to add Variants to the uses clause; most later versions add it for you. I don’t remember which category Delphi 5 fell into.
Related Contents:
- Get list of all runing processes (with processName+ProcessPath+ProcessTitle) [closed]
- Delphi – Split Lines(Program not responding), not spliting file size (TTHREAD)
- Why can a WideString not be used as a function return value for interop?
- Problems with ADC/SBB and INC/DEC in tight loops on some CPUs
- Are delphi variables initialized with a value by default?
- How to have Delphi TWebbrowser component running in IE9 mode?
- How can I search for Delphi documentation? [closed]
- Delphi: Access Violation at the end of Create() constructor
- List of Delphi language features and version in which they were introduced/deprecated
- Delphi: Prompt for UAC elevation when needed
- Proper structure syntax for Delphi/Pascal if then begin end and ;
- Split a string into an array of strings based on a delimiter
- How can I tell if another instance of my program is already running?
- How to dynamically create controls aligned to the top but after other aligned controls?
- Getting output from a shell/dos app into a Delphi app
- Which variables are initialized when in Delphi?
- How to define application version in one place for multiple applications?
- Delphi 2010: How to save a whole record to a file?
- Registration-free COM/DLL?
- Profiler and Memory Analysis Tools for Delphi [closed]
- What’s the simplest way to call Http GET url using Delphi?
- I do not understand what Application.ProcessMessages in Delphi is doing [closed]
- Antivirus False positive in my executable
- Why should I not use “with” in Delphi?
- How do I let Delphi know I’ve already handled an exception?
- How to use ScanLine property for 24-bit bitmaps?
- How to use Animated Gif in a delphi form
- How do I send a string from one instance of my Delphi program to another?
- How can I allow a form to accept file dropping without handling Windows messages?
- Converting TMemoryStream to ‘String’ in Delphi 2009
- Google like edit/combo control for Delphi?
- Delphi Conversion Unicode Issues
- How to distinguish Multiple Keyboards in Delphi?
- How do I sort a generic list using a custom comparer?
- Which logging library is better? [closed]
- Load Jpg/Gif/Bitmap and convert to Bitmap
- How do I translate a C union into Delphi?
- Creating a component with named sub-components?
- Conversion between absolute and relative paths in Delphi
- Rotate bitmap by real angle
- How do I run a command-line program in Delphi?
- Using 7-Zip from Delphi?
- How to add manifest info into delphi project
- How to associate a program with a file type, but only for the current user?
- FTP Over SSH (SFTP) In delphi 2010
- Delphi – get what files are opened by an application
- How to send a HTTP Post Request in Delphi 2010 using WinInet [duplicate]
- My program never releases the memory back. Why?
- WWW server reports error after POST Request by Internet Direct components in Delphi
- How to get the Memory Used by a Delphi Program