I am programming the back end of my site (ASP.Net C # framework 4.0). I listen to the results using my PayPal IPN listener, which will update my internal database.
When the payment is made, I would like to record the date of payment. I had a problem parsing the payment_date parameter, which is provided to me from an IPN message. It looks like this:
args["payment_date"]: 10:23:05 Dec 02, 2013 PST
The following try-parse parameter always returns false:
DateTime paymentDate = DateTime.UtcNow;
DateTime.TryParse(args["payment_date"], out paymentDate);
Does PST mean Pacific Standard Time? 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 any way I can ask PayPal to give me the payment date in UTC? Or do I need to write my own parser? If so, is there anything else I should watch for except switching from PST to PDT?
You might think that I just need to 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 in the actual IPN message.
source
share