API General Update Request | Include TimeZone on all datetimes
-
- Posts: 118
- Joined: Wed Apr 06, 2022 12:04 pm
API General Update Request | Include TimeZone on all datetimes
Would love to see timezone including on all dates, including DateTStamp, serverDateTime, and especially AptDateTime
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: API General Update Request | Include TimeZone on all datetimes
Including it in the date field seems like a breaking change. On the other hand, everyone is probably parsing the date with a library that could easily handle the change. Still, I think we'll need to make it an option that you intentionally turn on.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
Re: API General Update Request | Include TimeZone on all datetimes
The addition of time zone information has been added to our development list. The output string will be in "yyyy-MM-dd HH:mm:sszzz" format, and so will appear as "2022-05-19 09:42:45-07:00". Our plan is to toggle on the time zone information with a URL parameter. This will allow developers to opt into this new format and preserve existing behavior/prevent a breaking change.
Re: API General Update Request | Include TimeZone on all datetimes
In an effort to support many different type of DateTime formats, we have added a new URL parameter for API requests called DateTimeFormatString. This parameter is available for all API requests and will allow developers to fully customize the way all returned DateTimes (dates in "yyyy-MM-dd HH:mm:ss" format) are displayed.
The new DateTimeFormatString can be set to any format string found here https://docs.microsoft.com/. Common examples include:
Returning:
Please see the section under DateTime Format on our API Implementation page. This will be available in our next beta version, 22.2.14, which is estimated to be released within the next week.
The new DateTimeFormatString can be set to any format string found here https://docs.microsoft.com/. Common examples include:
- Time Zones: yyyy-MM-dd HH:mm:ss zzz (2022-06-17 15:46:45 -7:00)
- Day-Month-Year: dd-MM-yyyy HH:mm:ss (17/06/2022 15:46:45)
- 12-Hour times: yyyy-MM-dd hh:mm:ss tt (2022-06-17 03:46:45 PM)
- Long versions: dddd, MMMM d, yyyy HH:mm:ss (Friday, June 17, 2022 15:46:45)
- Other separating characters: MM/dd/yy HH:mm:ss (06/17/22 15:46:45)
Code: Select all
GET /patients/Simple?DateTimeFormatString=dd/MM/yyyy HH:mm:ss zzz
Code: Select all
{
"PatNum": 48,
"LName": "Smith",
"FName": "Jane",
...
"DateTStamp": "08/12/2021 15:34:34 -7:00"
}
Please see the section under DateTime Format on our API Implementation page. This will be available in our next beta version, 22.2.14, which is estimated to be released within the next week.