Valid Date and DateTime formats

Specify the right format for dateTime and date fields.

dateTime

Use the YYYY-MM-DDThh:mm:ssZ+/-HH:mm or YYYY-MM-DDThh:mm:ss.SSSZ formats to specify dateTime fields.

  • YYYY is the four-digit year
  • MM is the two-digit month (01-12)
  • DD is the two-digit day (01-31)
  • ‘T’ is a separator indicating that time-of-day follows
  • hh is the two-digit hour (00-23)
  • mm is the two-digit minute (00-59)
  • ss is the two-digit seconds (00-59)
  • SSS is the optional three-digit milliseconds (000-999)
  • +/-HH:mm is the optional Zulu (UTC) time zone offset
  • ‘Z’ is the reference UTC timezone.

date

Use the YYYY-MM-DD format to specify date fields. Such as 2024-05-03.

GraphQL Examples

Creating a Job with Start and End dateTimes

mutation {
schema {
  createJob(input: {
    Duration: "60",
    Description: "Inserted via GraphQL!"
    RegionId:"YOUR-REGION-UID"
    Start: "2025-01-18T13:18:00Z"
    End: "2025-01-18T14:18:00Z"
  })
}
}

Creating a Job with dateTime offsets

mutation {
schema {
  createJob(input: {
    Duration: "60",
    Description: "Inserted via GraphQL!"
    RegionId:"YOUR-REGION-UID"
    Start: "2025-01-18T13:18:00+5:00"
    End: "2025-01-18T14:18:00+5:00"
  })
}
}

REST API Example

Creating a conflict via the Rule Violations (Conflicts) API


curl --request PUT \
  --url https://api.skedulo.com/rules/violation \
  --header 'Authorization: Bearer $YOUR-API-KEY' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/8.5.1' \
  --data '{
  "ruleId": "unsafeArea",
  "targetId": "b055d7c1-ef2f-40e9-bcd2-634e9835e69b",
  "sourceId": "5c832cd6-006b-454a-b747-5cb62beef885",
  "targetType": "job",
  "sourceType": "job",
  "startTime": "2024-01-01T00:00:00.000Z",
  "endTime": "2024-01-01T01:00:00.000Z",
  "regionId": "6cdd3be8-6fab-44c5-a6b7-e9ddc6860eb7",
  "resourceIds": [
    "d5ed41db-87ee-4dd2-a65c-dd37dc253d3b"
  ],
  "description": "Job is in an area that may be unsafe",
  "link": {
    "type": "skedulo",
    "name": "Job"
  },
  "context": {}
}'