# Type local\_date\_time. in /api/v2/settings/objects and Maintenance Window

**URL:** <https://community.dynatrace.com/t/type-local-date-time-in-api-v2-settings-objects-and-maintenance-window/36243>\
**Category:** Dynatrace API\
**Tags:** maintenance-window\
**Created:** [August 16, 2022, 8:47pm UTC](https://community.dynatrace.com/t/type-local-date-time-in-api-v2-settings-objects-and-maintenance-window/36243 "2022-08-16T20:47:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZiemekBorowski](https://avatars.discourse-cdn.com/v4/letter/z/b2d939/32.png) [@ZiemekBorowski](https://community.dynatrace.com/u/ZiemekBorowski)\
**Post date:** [August 16, 2022, 8:47pm UTC](https://community.dynatrace.com/t/type-local-date-time-in-api-v2-settings-objects-and-maintenance-window/36243/1 "2022-08-16T20:47:33Z")

</div>

Hello,

I tried to setup MW as bellow

```javascript
[
  {
    "schemaId": "builtin:alerting.maintenance-window",
    "scope": "environment",
    "schemaVersion": "2.14",
    "value": {
      "enabled": true,
      "generalProperties": {
        "name": "Example Window ZZZZ",
        "description": "An example Maintenance window ZZZZ",
        "maintenanceType": "UNPLANNED",
        "suppression": "DETECT_PROBLEMS_DONT_ALERT",
        "disableSyntheticMonitorExecution": false
      },
      "schedule": {
        "scheduleType": "ONCE",
        "onceRecurrence": {
          "startTime": "18:00:00.00",
          "endTime": "19:00:00.00",
          "timeZone": "Europe/Berlin"
        }
      },
      "filters": [
        {
          "entityType": "HOST",
          "entityTags": [
            "PatchGroup:t1g1"
          ],
          "managementZones": [
            "1234567890123455"
          ]
        }
      ]
    }
  }
]

```

but all call of API finish with warning:

```javascript
Post to Dynatrace failed.; Error `Create failed with code 400and error: 
{
  "code": 400,
  "message": "Validation failed for 2 Validators.",
  "constraintViolations": [
    {
      "path": "builtin:alerting.maintenance-window/0/schedule/onceRecurrence/startTime",
      "message": "Given property 'startTime' with value: '20:00:00' violates the following constraint: Must be of type local_date_time.",
      "parameterLocation": "PAYLOAD_BODY",
      "location": null
    },
    {
      "path": "builtin:alerting.maintenance-window/0/schedule/onceRecurrence/endTime",
      "message": "Given property 'endTime' with value: '21:00:00' violates the following constraint: Must be of type local_date_time.",
      "parameterLocation": "PAYLOAD_BODY",
      "location": null
    }
  ]
}`

```

I tested many of format of time and datetime - all wrong.

Any idea?

.

---

<div class="post-metadata">

**Author:** ![ZiemekBorowski](https://avatars.discourse-cdn.com/v4/letter/z/b2d939/32.png) [@ZiemekBorowski](https://community.dynatrace.com/u/ZiemekBorowski)\
**Post date:** [August 17, 2022, 7:31am UTC](https://community.dynatrace.com/t/type-local-date-time-in-api-v2-settings-objects-and-maintenance-window/36243/2 "2022-08-17T07:31:24Z")

</div>

OK, I learn that:

**local\_date\_time** type follows the following format: year-month-day-hour-minute-second, so for your configuration you will need to adapt the schedule to something like:

startTime: “2022-08-17T20:00:00”
