What date format does Kronos Workforce Central expect?

1.3k Views Asked by At

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?

1

There are 1 best solutions below

0
Stevoisiak On BEST ANSWER

By default, Kronos Workforce Central is configured to format long dates as M/dd/yyyy.

  • M: Month number, no leading zero
  • dd: Day number, leading zero
  • yyyy: Year number, 4 digits

As 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

<Kronos_WFC version='1.0'>
    <Request Action='Load'>
        <Timesheet>
            <Employee>
                <PersonIdentity PersonNumber = '12345'/>
             </Employee>
             <Period>
                 <TimeFramePeriod PeriodDateSpan = '10/23/2017 - 10/30/2017'/>
             </Period>
         </Timesheet>
     </Request>
</Kronos_WFC>

Tip: If you need to determine the server's current date, you can send a GetServerTime request to make the server respond with it's date and time. This DateTime can be reused for requests which require a ChangeDate or EffectiveDate.

Request:

<Kronos_WFC version="1.0">
    <Request Object="ServerTime" Action="GetServerTime" />
</Kronos_WFC>

Response:

<Kronos_WFC version="1.0" WFCVersion="6.3.13.362" TimeStamp="10/31/2017 11:08AM GMT-04:00">
    <Response Status="Success" Object="ServerTime" Action="GetServerTime">
        <ServerTime DateTime="10/31/2017 11:08AM" KronosTimeZone="(GMT -05:00) Eastern Time"/>
    </Response>
</Kronos_WFC>

Additionally, the root <Kronos_WFC> tag in the server's response should always include a TimeStamp attribute with the current date and time on the server.

TimeStamp="10/31/2017 11:08AM GMT-04:00"