Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

New Developer
Posts: 15
Registered: ‎08-14-2013
My Device: Bold 9000
My Carrier: T-Mobile

Different Date Time format handling



I'm about to develop a little app, that iterates through a user list and check if the LastContactDate is older than a specific value.

I'm using the floowing code:


Convert.ToDateTime(user.lastContactDate).Subtract(System.DateTime.Now).TotalDays >= 150

 But there are users where I get FormatException on this line.


When I checked the users I saw the last contact date begins with the month than days, years and so on, but the System.DateTime.Now begins with day than month, years, and so on.


I'd like to know how to parse this date time, because all my try was failed so far. Smiley Sad