title: Converting a string to TDateTime based on an arbitrary format
body: <p>Is there any way in Delphi 5 to convert a string to a TDateTime where you can specify the actual format to use?</p>
  <p>I'm working on a jobprocessor, which accepts tasks from various workstations. The tasks have a range of parameters, some of which are dates, but (unfortunately, and out of my control) they're passed as strings. Since the jobs can come from different workstations, the actual datetime format used to format the dates as a string might (and, of course, actual <em>do</em>) differ.</p>
  <p>Googling around, the only quick solutions I found was to sneakily change the <code>ShortDateFormat</code> variable, and restore it to its original value afterwards. Since <code>ShortDateFormat</code> is a global variable, and I'm working in a threaded environment the only way this would work is by synchronizing every access to it, which is completely unacceptable (and undoable).</p>
  <p>I could copy the library code from the <code>SysUtils</code> unit into my own methods, and tweak them to work with a specified format instead of the global variables, but I'm just wondering if there's something more adequate out there that I missed.</p>
  <p><strong>UPDATE</strong></p>
  <p>To put it more succinctly:</p>
  <p>I need something like <code>StrToDate</code> (or <code>StrToDateTime</code>), with the added option of specifying the exact format it should use to convert the string to a TDateTime.</p>