---
name: "updateDpPeriodTime"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "updateDpPeriodTime - Set time period."
summary: "Set time period."
---

## updateDpPeriodTime

> [VERSION] @ray-js/lock-sdk >= 1.0.0

### Description

Update the time range of a time-range DP

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `dpCode` | `string` | Yes | DP code |
| `data` | `UpdateDpPeriodTimeParams` | Yes | Start/end time |
| `option` | `UpdateDpPeriodTimeOption` | No | Options |

### Return Value

Type: `Promise<void>`

None (resolve after successful delivery)

### Referenced Types

##### `interface` UpdateDpPeriodTimeParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `start` | `number` | Yes | Start time (minutes) |
| `end` | `number` | Yes | End time (minutes) |

##### `interface` UpdateDpPeriodTimeOption

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `offlineDp` | `boolean` | No | Whether to use offline task delivery when the device is offline |


### Examples

```ts
import { updateDpPeriodTime } from '@ray-js/lock-sdk';
await updateDpPeriodTime('dp_code', { start: 0, end: 100 });
```
