I am programming the back end of my website (ASP.Net C# framework 4.0). I am listening for results using my PayPal IPN listener, which will update my back-end database.
When a payment is made I would like to record the payment date. I am having trouble parsing the payment_date parameter that is given to me from the IPN message. It looks like this:
args["payment_date"]: 10:23:05 Dec 02, 2013 PST
The following try-parse is always returning a false:
DateTime paymentDate = DateTime.UtcNow;
DateTime.TryParse(args["payment_date"], out paymentDate);
PST stands for Pacific Standard Time right? I read that some US states that use PST will switch to PDT (Pacific Daylight Time) at some point in the year.
In my database I would like to store all DateTimes as UTC. Is there a way that I can ask PayPal to give me the payment date in UTC? Or do I have to write my own parser? If so then is there anything else I should watch out for apart from the switch from PST to PDT?
Perhaps you might think I should just use my own server time to record the payment date, but I just thought it would be better to use the date given by PayPal themselves in the actual IPN message.