How to parse string input that may have different date format?
<p>E.g. i might have input string like below:</p>

<p>2012-07-23T03:30:00.000Z</p>

<p>or </p>

<p>2012-06-25T13:00:00.000+08:00</p>

<p>For these two case, i have different date formats to parse like e.g. if is 2012-07-23T03:30:00.000Z then i need to use yyyy-MM-dd'T'KK:mm:ss'.000Z</p>

<p>then if is 2012-06-25T13:00:00.000+08:00 i need to use yyyy-MM-dd'T'KK:mm:ss'.000+08:00</p>

<p>is it ok to do a date parsing to find out the format?</p>

<p>But if i parse then in my logs files i may see many exception being thrown out.</p>

<p>Or is there an more elegant way of handling this issue?</p>

<p>Thanks</p>
