Highlighted
Absent Member.
Absent Member.
8909 views

Creating a primary record via Web Service API produces unexpected date/time values


I asked this question to support and was told I should try here.

We are creating primary items using the web service API. One of the fields in these records is a date/time field. After performing the injection and pulling up the item in SBM, the time is off by 4 hours (Which is the offset set in our Locale in SBM Administrator). I know that all dates are stored in the database as GMT and the locale information is applied when viewing the dates and times in the user interface.

I've come up with a solution that works, but isn't ideal. From my external application, I send the date to a text field formatted as it would appear in the SBM date field (MM/DD/YYYY HH:mm:SS). After the submit, I have a pre-state AppScript action that assigns the value of the text field to the date field so long as it is indeed a date. Since we're not writing directly to the database, the proper date and time is saved and later displayed in the web interface.

Has anyone else worked with a problem like this before? Thanks.
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

Re: Creating a primary record via Web Service API produces unexpected date/time values


Jason,

In the Web Services api guide there is a section called "Supported Date/Time Formats" with some examples of using an offset. You might experiment with some of the options to see if it gives you better results. I was using this format "2006-04-28T13:20:00-7:00" which offsets the value by 7. Our offset is actually 8 but not sure with daylight savings etc. how that works but 7 seem to give the result I was looking for.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.