What are you sending for the date value in your API call? Just the date or do you include a time value in the JSon?
Just the date formatted ‘yyyy-MM-dd’
made sure the time zone is correct in my user profile.
The date in user profile does not affect the API calls.
Try sending the datetime with the timezone shift component
So, I don’t have the perfect answer for you which means you’ll have to do some experimentation to see what works and if you can come up with a rule.
Depending on the date field, it can store more than just the date.
You can add more to the JSon value. The following will set the field to July 21st, 2022 at midnight (GMT) offset to the Eastern Timezone (for half of the year):
"2022-07-21T00:00:00-04:00"
Another way to test is to set your profile timezone to GMT. Enter an order through the UI. Then set your profile to another timezone and enter an order. Then set your profile to yet another timezone and create a third order. Then review what is stored in the database for those three orders.
I never dug more into the subtleties with this as the project ended. I’m in the PST zone and the orders were going into ACM for a company on the east coast of the US so I had to keep the dates straight in my head during testing. In addition, some date fields don’t care about time components which makes the above act differently when you compare entering orders into the UI.
@Dmitrii Naumov, thank you for that info I did not know that. I would have assumed user profile timezone mattered especially since I am using the user credential authentication flow!
When I look at my JSON response data, everything looks to be correct:
{
"CreatedDate": {
"value": "2024-06-12T18:44:10.347+00:00"
},
"Date": {
"value": "2024-06-12T00:00:00+00:00"
},
"EffectiveDate": {
"value": "2024-06-12T00:00:00+00:00"
},
"LastModified": {
"value": "2024-06-12T18:44:10.347+00:00"
},
"RequestedOn": {
"value": "2024-06-17T00:00:00+00:00"
},
"custom": {
"Document": {
"UsrNVFSDeliveryDate": {
"type": "CustomDateTimeField",
"value": "2024-06-13T00:00:00"
}
}
}
}
This is every date-related value I receive in my sales order creation response unless it is something in my cookies that shows the issue?
"Locale=Culture=en-US&TimeZone=GMTM0500G; expires=Sat, 15-Jun-2024 18:44:06 GMT; path=/",
"CompanyID=xxxxxxx; expires=Sat, 15-Jun-2024 18:44:06 GMT; path=/",
"UserBranch=xxxxx; path=/",
"Locale=Culture=en-US&TimeZone=GMTM0500G; expires=Sat, 15-Jun-2024 18:44:06 GMT; path=/",
"CompanyID=xxxxxxx; expires=Sat, 15-Jun-2024 18:44:06 GMT; path=/",
"UserBranch=xxxxxxx; path=/",
"requestid=xxxxxxxx; path=/",
"requeststat=xxxxx; path=/"
],
Hi @jmu216 were you able to find a solution? Thank you!