<p>I want to use the DateTime.TryParse method to get the datetime value of a string into a Nullable.  But when I try this:</p>

<pre><code>DateTime? d;
bool success = DateTime.TryParse("some date text", out (DateTime)d);
</code></pre>

<p>the compiler tells me </p>

<blockquote>
  <p>'out' argument is not classified as a variable</p>
</blockquote>

<p>Not sure what I need to do here.  I've also tried: </p>

<pre><code>out (DateTime)d.Value 
</code></pre>

<p>and that doesn't work either.  Any ideas?</p>

```
```
DateTime? d=null;
DateTime d2;
bool success = DateTime.TryParse("some date text", out d2);
if (success) d=d2;
```
```
(There might be more elegant solutions, but why don't you simply do something as above?)