简体   繁体   English

Kronos Workforce Central 期望什么日期格式?

[英]What date format does Kronos Workforce Central expect?

I have an XML request which asks the Kronos Workforce Central API for an employee's pay period total over a specified time period.我有一个 XML 请求,它向 Kronos Workforce Central API 询问员工在指定时间段内的工资期总额。

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我使用PeriodDateSpan = '2017/10/23 - 2017/10/30'来指定支付期,确保遵循典型的yyyy/mm/dd日期格式

<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.当我将此请求发送到我的 WFC 访问点wfc/XmlService ,服务器响应错误,指出我的DatePeriodSpan值无效。

<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 ?指定PeriodDateSpan时,Kronos 期望什么日期格式?

By default, Kronos Workforce Central is configured to format long dates as M/dd/yyyy .默认情况下,Kronos Workforce Central 配置为将长日期格式化为M/dd/yyyy

  • M : Month number, no leading zero M : 月数,没有前导零
  • dd : Day number, leading zero dd : 天数,前导零
  • yyyy : Year number, 4 digits yyyy : 年份编号,4 位

As an example, June 8, 2018 would be formatted as 6/08/2018 .例如,2018 年 6 月 8 日将被格式化为6/08/2018 The timespan specified in the question would be formatted as <TimeFramePeriod PeriodDateSpan = '10/23/2017 - 10/30/2017'/>问题中指定的时间跨度将被格式化为<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假设日期格式未更改为默认值,以下是针对员工工资期总计的更正 XML 请求

<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.提示:如果您需要确定服务器的当前日期,您可以发送一个GetServerTime请求,让服务器响应它的日期和时间。 This DateTime can be reused for requests which require a ChangeDate or EffectiveDate .此 DateTime 可以重用于需要ChangeDateEffectiveDate请求。

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.此外,服务器响应中的根<Kronos_WFC>标记应始终包含带有服务器上当前日期和时间的TimeStamp属性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM