Issues/Bug with specific windows date format

Sep 9, 2014 at 10:06 AM

Here is the line of code to use for testing:
IUser user = User.GetUserFromScreenName("TWITTER_ID");
If I set my computer date format to MM/dd/yyyy and we are the 23 September (09/23/2014), the GetUserFromScreenName return null. If we are on the 1st September, there is no problem.

Do you know why? Is there problems with deserializing dates?

Sep 9, 2014 at 7:11 PM

In the documentation there is the Before you start section.
Please verify that the time of your machine is correctly setup (both the time and the region).
Having an incorrect Time can result in receiving the 401 exception.
Twitter does not authorize a query to be sent with an invalid DateTime. Currently Tweetinvi is relying on the Windows DateTime of the current machine.
Tweetinvi is also handling exceptions for developers, and the 401 exception is handled to return null in your case.

Hope this help.
Sep 10, 2014 at 8:48 AM
Edited Sep 10, 2014 at 8:49 AM
I don't understand. Here is the configuration of my computer.


Based on your statement, every English system will not work with your library because of the date format M/d/yyyy.
Sep 10, 2014 at 5:12 PM
Of course not, in fact I am myself using the MM/dd/yyyy format on my computer.
I am just informing you that the date and time of your machine must be correct otherwise the API will throw a 401 exception, resulting in any query to return null.

Sep 10, 2014 at 5:49 PM
Probably a stupid question but what do you means by "correct". I tested many date format in the region settings and none of them works.
Sep 10, 2014 at 7:27 PM
Sorry for the confusion, I meant that you must set the time on your machine as it is expected for your ip.
I you are located in New York for example, set the time to universal and then change the Time Zone to be Eastern Time.

If the problem does not come from this, please send me the information you can find in the Exception Handler (doc).

Sep 15, 2014 at 8:42 AM
I tested many datetime formats and it's working.
The only case that failed is when the date is not correct.

Thanks for help.
Marked as answer by linvi on 9/16/2014 at 3:02 AM