Posted By

krisdb on 09/02/09


Tagged

c-sharp


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


DateTime.TryParse


 / Published in: C#
 

  1. DateTime date = new DateTime();
  2.  
  3. if (DateTime.TryParse(Request.QueryString["Date"], out calDate))
  4. {
  5.  
  6. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: kaputtnik on September 2, 2009

out-parameters doesn't need to be instantiated - you can safe a little bit CPU-Time

DateTime date; if(DateTime.TryParse("...",out date)) { ... }

Posted By: krisdb on September 10, 2009

Good to know, thanks.

You need to login to post a comment.