How to get the correct default value of date time fields Using Rest API?

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
mahadev
User
Posts: 22
Joined: Fri Jun 21, 2019 8:03 am

How to get the correct default value of date time fields Using Rest API?

Post by mahadev » Wed Nov 20, 2019 2:49 am

Hi Team ,
In bullhorn crm - TimeZone as IST and set the default datetime as 08/20/2017 01:00 PM. But I got incorrect default date time field value when i called below api .

Code: Select all

 <Endpoint>/meta/Candidate?fields=*&meta=full&BhRestToken=******
Response :

Code: Select all

 {
            "name": "dateAvailableEnd",
            "type": "SCALAR",
            "dataType": "Timestamp",
            "dataSpecialization": "DATETIME",
            "confidential": false,
            "optional": true,
            "label": "Available Until",
            "required": false,
            "readOnly": false,
            "multiValue": false,
            "defaultValue": 1503201600000,
            "hideFromSearch": false,
            "sortOrder": 5121,
            "hint": "",
            "description": "",
            "systemRequired": false
        }
When i convert milliseconds to date - "defaultValue": 1503201600000 - Sunday, August 20, 2017 4:00:00 AM

Can you help me to resolve this one.

bashen
User
Posts: 8
Joined: Wed Jul 11, 2018 5:09 pm

Re: How to get the correct default value of date time fields Using Rest API?

Post by bashen » Fri Nov 22, 2019 4:28 pm

My guess is that Bullhorn is ignoring the time portion ("01:00PM") when setting the field and only using the day portion ("08/20/2017").

Bullhorn stores their dates in ET (Eastern Timezone). So, this date would be stored as "08/20/2017 12:00 AM ET". The Bullhorn REST API returns dates in UTC time so "08/20/2017 12:00 AM ET" is converted to "08/20/2017 04:00 AM UTC" and then to the Unix timestamp you see in your REST response.

Post Reply