REST API: Start time of task

When creating a task using the REST API, the date/time needs to be in this format: P3DT15H36M12S. That string is an offset from the current time to the scheduled start time.

My question is this… when creating a task using StartDateTimeLocalOffset (for “client local time”) is that date/time string an offset from the computer that is creating the task or for the computer that will be executing the task?

It gets translated to this in the .fxf file:

action-end-time: Thu, 21 Mar 2019 10:01:02

So the client is unaware that there is an offset involved at all. When using the REST API you just submit the offset <EndDateTimeLocalOffset>P2D</EndDateTimeLocalOffset>.

So the offset is based on the current server time – P2D is 2 days from when the action was submitted to the REST API and gets translated to a specific day and time.

That’s what I was hoping for. Thanks.

Let’s say that the server hosting the REST API is in the US Eastern time zone, and the computer that will be targeted is in China. I would need to translate the start/end times from the current time zone to the target’s time zone when submitting, correct?

When you submit the action at 10am Eastern and say it expires in 2 days you’re saying, “Run this action at 10am Client Local Time and expire it in 2 days”.

In other words: Start at 10am in CST (China Standard Time) and expire two days after that.

So if you want it to start at some other time you would need to offset the start time.

1 Like

@strawgate . We are having the same issue while executing an action using REST API on clients. We have tried to define an action which has a 2 hour end time on the client. But it adds the offset to the server time instead of the client time. We do not specify any start time. Which means, we send an action now using Rest API to 3-4 clients with endtimelocaloffset , some are in APAC and it does not even start. Server in CET timezone.

-

true

PT2H

false

true

3

An alternative option would be using the client local time (instead of the offset time). The tags are:

<StartDateTimeLocal>
<EndDateTimeLocal> 

As for example:

<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
      <SourcedFixletAction>
        <SourceFixlet>
            <Sitename>ActionSite</Sitename>
            <FixletID>2209</FixletID>
            <Action>Action1</Action>
        </SourceFixlet>
        <Target>
            <ComputerName>your_hostname</ComputerName>
        </Target>
		<Settings>
		<HasStartTime>true</HasStartTime>
		<StartDateTimeLocal>2021-02-25 16:30:00</StartDateTimeLocal>
		<EndDateTimeLocal>2021-02-27 18:30:00</EndDateTimeLocal >
		</Settings>
      </SourcedFixletAction>
</BES>