<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'can't convert date' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'can't convert date' posted on the 'Delphi and Kylix' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 07:57:06 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 07:57:06 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>can't convert date</title>
      <link>http://www.programmersheaven.com/mb/delphikylix/291526/291526/cant-convert-date/</link>
      <description>hi, i want to enter dates into the db that i have created with the format(dd-mm-yyyy) that i used to! but i don't think delphi can read it. so i want to turn off exception check, and not to write a data validation code. i am using delphi 7, but the book i have is for delphi 5! is there any one can help? thanks!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/delphikylix/291526/291526/cant-convert-date/</guid>
      <pubDate>Tue, 08 Feb 2005 02:28:57 -0700</pubDate>
      <category>Delphi and Kylix</category>
    </item>
    <item>
      <title>Re: can't convert date</title>
      <link>http://www.programmersheaven.com/mb/delphikylix/291526/291529/re-cant-convert-date/#291529</link>
      <description>: hi, i want to enter dates into the db that i have created with the format(dd-mm-yyyy) that i used to! but i don't think delphi can read it. so i want to turn off exception check, and not to write a data validation code. i am using delphi 7, but the book i have is for delphi 5! is there any one can help? thanks!&lt;br /&gt;
: &lt;br /&gt;
Here is a simple straight-forward code:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  try
    Day := StrToInt(DateStr[1]+DateStr[2]);
    Month := StrToInt(DateStr[4]+DateStr[5]);
    Year := StrToInt(Copy(DateStr, 8, 4));
    Date := EncodeDate(Year, Month, Day);
  except
    ShowMessage('Invalid date format. Must be dd-mm-yyyy');
  end;
&lt;/pre&gt;&lt;br /&gt;
Remember that the debugger ALWAYS handles the exception, before the program does. If you run this outside the debugger, the user will get the custom error.&lt;br /&gt;
You can also use the StrToDate() function, and specify the formatting by using the correct variables. See the online help for more info.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/delphikylix/291526/291529/re-cant-convert-date/#291529</guid>
      <pubDate>Tue, 08 Feb 2005 03:18:25 -0700</pubDate>
      <category>Delphi and Kylix</category>
    </item>
  </channel>
</rss>