njsokalski
Well-known member
- Joined
- Mar 16, 2011
- Messages
- 102
- Programming Experience
- 5-10
I have dates from a data file that I need to parse. Here is an example of one of the dates and what I have so far:
DateTime.ParseExact("2013-01-26T02:43:55+0000","yyyy-MM-dd\THH:mm:ss",
As you can see, the date includes the timezone offset (the "+0000" part at the end). I am not sure how to add that to the format string, since the date format pages I found only showed how to include the timezone offset as -0, -00, or -00:00. First of all, I do not have a dash before the timezone offset (I have a +, which I assume I can add using \+), and second, I need 4 digits, not 1 or 2. I am also not sure what to put for the provider parameter of the ParseExact method. Can somebody help me here? Thanks.
DateTime.ParseExact("2013-01-26T02:43:55+0000","yyyy-MM-dd\THH:mm:ss",
As you can see, the date includes the timezone offset (the "+0000" part at the end). I am not sure how to add that to the format string, since the date format pages I found only showed how to include the timezone offset as -0, -00, or -00:00. First of all, I do not have a dash before the timezone offset (I have a +, which I assume I can add using \+), and second, I need 4 digits, not 1 or 2. I am also not sure what to put for the provider parameter of the ParseExact method. Can somebody help me here? Thanks.