I have an XML request which asks the Kronos Workforce Central API for an employee's pay period total over a specified time period.
I am using PeriodDateSpan = '2017/10/23 - 2017/10/30' to specify the pay period, making sure to follow the typical yyyy/mm/dd format for dates
<Kronos_WFC version='1.0'>
<Request Action='Load'>
<Timesheet>
<Employee>
<PersonIdentity PersonNumber = '12345'/>
</Employee>
<Period>
<TimeFramePeriod PeriodDateSpan = '2017/10/23 - 2017/10/30'/>
</Period>
</Timesheet>
</Request>
</Kronos_WFC>
When I send this request to my WFC access point wfc/XmlService, the server responds with an error stating that my value for DatePeriodSpan is not valid.
<Kronos_WFC version="1.0" WFCVersion="6.3.13.362" TimeStamp="10/31/2017 11:08AM GMT-04:00">
<Response Status="Failure" Action="Load">
<Error Message="WFP-00950 The value is not valid for the property - Name: PeriodDateSpan, Value: 2017/10/20 - 2017/10/27." ErrorCode="1102" AtIndex="0" PropertyName="PeriodDateSpan" PropertyValue="2017/10/20 - 2017/10/27"/>
</Response></Kronos_WFC>
What date format does Kronos expect when specifying a PeriodDateSpan?
By default, Kronos Workforce Central is configured to format long dates as
M/dd/yyyy.M: Month number, no leading zerodd: Day number, leading zeroyyyy: Year number, 4 digitsAs an example, June 8, 2018 would be formatted as
6/08/2018. The timespan specified in the question would be formatted as<TimeFramePeriod PeriodDateSpan = '10/23/2017 - 10/30/2017'/>The date format may differ on a server-by-server basis, as configured by the server administrator (Setup -> System Configuration -> System Settings -> Locale).
Assuming the date format has not been changed from defaults, below is a corrected XML request for an employee's Pay Period Total
Tip: If you need to determine the server's current date, you can send a
GetServerTimerequest to make the server respond with it's date and time. This DateTime can be reused for requests which require aChangeDateorEffectiveDate.Request:
Response:
Additionally, the root
<Kronos_WFC>tag in the server's response should always include aTimeStampattribute with the current date and time on the server.