title: DateDiff and regional settings
body: <p>I've got a VBscript that runs on devices placed all over the world and therefore uses various regional settings.</p>
  
  <p>A part of my script is calculating the difference between 2 dates, but I can't get that working with a consistent result.</p>
  
  <p>An example:</p>
  
  <pre><code>'Get system date in EU format    
  dEUDate = Right("0" &amp; DatePart("d",Date), 2) &amp; "-" &amp; Right("0" &amp; DatePart("m",Date), 2) &amp; "-" &amp; DatePart("yyyy",Date)
  
  'Read date/time value from an application in registry - will return e.g. 05-01-2013 07-19-00
  dateKLAVDef = UCase(objShell.RegRead(strKLAVStateKey &amp; "\Protection_BasesDate"))
  
  'Find date difference
  iAVDefAge = DateDiff("d", Left(dateKLAVDef, 10), dEUDate)
  
  WScript.Echo "AV def.: " &amp; dateKLAVDef &amp; vbTab &amp; "Current date: " &amp; dEUDate &amp; vbTab &amp; "Diff: " &amp; iAVDefAge
  </code></pre>
  
  <p>This is the result when the device is configured with EU regional settings which gives the correct result:</p>
  
  <p>AV def.: 05-01-2013 07-19-00    Current date: 07-01-2013        Diff: 2</p>
  
  <p>This is the result when the device is configured with non-EU regional settings (e.g. English (United States)) which (from the scripts point of view) is incorrect:</p>
  
  <p>AV def.: 05-01-2013 07-19-00    Current date: 07-01-2013        Diff: 61</p>
  
  <p>How can I get this working with non-EU regional settings?</p>
  
  <p>Thanks in advance.</p>