问题
When I try to create invoice using REST API I get validation error like:
"details":[{"field":"items.date","issue":"only date field allowed with (yyyy-MM-dd z) format. (was 2014-12-27T17:01:00Z)
I tried with 2014-12-27T17:01:00Z, 2014-12-27Z, and number of others, but I get always the same error.
What kind of format should date be? Can you give me an example?
回答1:
Went through same and the only "format" that worked for me is
2014-12-27 PST
where the "z" is a time zone. - e.g. PST PDT GMT
This goes for all dates in the Invoice - e.g. invoice date, due date
Hth.
回答2:
I had the same issue and this worked for me in PHP date('Y-m-d\TH:i:s\Z',$invoiceDate)
来源:https://stackoverflow.com/questions/27669961/date-format-when-creating-invoice