Skip to content

Commit a1e91da

Browse files
authored
Merge pull request #207541 from baanders/8-10-data-history
ADT: Add sourceTime note
2 parents 1785403 + 4a981c7 commit a1e91da

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

articles/digital-twins/how-to-manage-twin.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: Azure Digital Twins
55
description: See how to retrieve, update, and delete individual twins and relationships.
66
author: baanders
77
ms.author: baanders # Microsoft employees only
8-
ms.date: 02/23/2022
8+
ms.date: 08/10/2022
99
ms.topic: how-to
1010
ms.service: digital-twins
1111

@@ -230,18 +230,19 @@ The patch for this situation needs to update both the model and the twin's tempe
230230
231231
### Update a property's sourceTime
232232
233-
You may optionally decide to use the `sourceTime` field on twin properties to record timestamps for when property updates are observed in the real world. Azure Digital Twins natively supports `sourceTime` in the metadata for each twin property. For more information about this field and other fields on digital twins, see [Digital twin JSON format](concepts-twins-graph.md#digital-twin-json-format).
233+
You may optionally decide to use the `sourceTime` field on twin properties to record timestamps for when property updates are observed in the real world. Azure Digital Twins natively supports `sourceTime` in the metadata for each twin property. The `sourceTime` value must comply to ISO 8601 date and time format. For more information about this field and other fields on digital twins, see [Digital twin JSON format](concepts-twins-graph.md#digital-twin-json-format).
234234
235235
The minimum stable REST API version to support this field is the [2022-05-31](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31) version. To work with this field using the [Azure Digital Twins SDKs](concepts-apis-sdks.md), we recommend using the latest version of the SDK to make sure this field is included.
236236
237-
The `sourceTime` value must comply to ISO 8601 date and time format.
238-
239237
Here's an example of a JSON Patch document that updates both the value and the `sourceTime` field of a `Temperature` property:
240238
241239
:::code language="json" source="~/digital-twins-docs-samples/models/patch-sourcetime.json":::
242240
243-
>[!TIP]
244-
>To update the `sourceTime` field on a property that's part of a component, include the component at the start of the path. In the previous example, this would mean changing the path from `/$metadata/Temperature/sourceTime` to `myComponent/$metadata/Temperature/sourceTime`.
241+
To update the `sourceTime` field on a property that's part of a component, include the component at the start of the path. In the example above, this would mean changing the path value from `/$metadata/Temperature/sourceTime` to `myComponent/$metadata/Temperature/sourceTime`.
242+
243+
>[!NOTE]
244+
> If you update both the `sourceTime` and value on a property, and then later update only the property's value, the `sourceTime` timestamp from the first update will remain.
245+
245246
246247
### Handle conflicting update calls
247248

0 commit comments

Comments
 (0)