Skip to content

Commit dc34d6d

Browse files
Merge pull request #113973 from diberry/diberry/0505-luis-public-issue-53837
[Cogsvcs] LUIS - public issue 53837
2 parents df80366 + bf8a714 commit dc34d6d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

articles/cognitive-services/LUIS/luis-concept-data-alteration.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Data alteration - LUIS
33
description: Learn how data can be changed before predictions in Language Understanding (LUIS)
44
ms.topic: conceptual
5-
ms.date: 02/11/2020
5+
ms.date: 05/05/2020
66
---
77

88
# Alter utterance data before or during prediction
@@ -71,41 +71,43 @@ The Bing spell check API used in LUIS does not support a list of words to ignore
7171
When a LUIS app uses the prebuilt [datetimeV2](luis-reference-prebuilt-datetimev2.md) entity, a datetime value can be returned in the prediction response. The timezone of the request is used to determine the correct datetime to return. If the request is coming from a bot or another centralized application before getting to LUIS, correct the timezone LUIS uses.
7272

7373
### Endpoint querystring parameter
74-
The timezone is corrected by adding the user's timezone to the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356) using the `timezoneOffset` param. The value of `timezoneOffset` should be the positive or negative number, in minutes, to alter the time.
74+
The timezone is corrected by adding the user's timezone to the endpoint using the appropriate parameter based on the API version. The value of the parameter should be the positive or negative number, in minutes, to alter the time.
7575

76-
|Param|Value|
76+
|API version|Querystring parameter|
7777
|--|--|
78-
|`timezoneOffset`|positive or negative number, in minutes|
78+
|v2|`timezoneOffset`|
79+
|v3|`datetimeReference`|
7980

8081
### Daylight savings example
81-
If you need the returned prebuilt datetimeV2 to adjust for daylight savings time, you should use the `timezoneOffset` querystring parameter with a +/- value in minutes for the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356) query.
82+
If you need the returned prebuilt datetimeV2 to adjust for daylight savings time, you should use the querystring parameter with a +/- value in minutes for the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356) query.
8283

8384
#### [V2 prediction endpoint request](#tab/V2)
8485

8586
Add 60 minutes:
8687

87-
`https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?**timezoneOffset=60**&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
88+
`https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?timezoneOffset=60&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
8889

8990
Remove 60 minutes:
9091

91-
`https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?**timezoneOffset=-60**&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
92+
`https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?timezoneOffset=-60&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
9293

9394
#### [V3 prediction endpoint request](#tab/V3)
9495

9596
Add 60 minutes:
9697

97-
`https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?**timezoneOffset=60**&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
98+
`https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?datetimeReference=60&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
9899

99100
Remove 60 minutes:
100101

101-
`https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?**timezoneOffset=-60**&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
102+
`https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?datetimeReference=-60&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}`
102103

103104
Learn more about the [V3 prediction endpoint](luis-migration-api-v3.md).
104105

105106
* * *
106107

107-
## C# code determines correct value of timezoneOffset
108-
The following C# code uses the [TimeZoneInfo](https://docs.microsoft.com/dotnet/api/system.timezoneinfo) class's [FindSystemTimeZoneById](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid#examples) method to determine the correct `timezoneOffset` based on system time:
108+
## C# code determines correct value of parameter
109+
110+
The following C# code uses the [TimeZoneInfo](https://docs.microsoft.com/dotnet/api/system.timezoneinfo) class's [FindSystemTimeZoneById](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid#examples) method to determine the correct offset value based on system time:
109111

110112
```csharp
111113
// Get CST zone id
@@ -117,8 +119,8 @@ DateTime utcDatetime = DateTime.UtcNow;
117119
// Get Central Standard Time value of Now
118120
DateTime cstDatetime = TimeZoneInfo.ConvertTimeFromUtc(utcDatetime, targetZone);
119121

120-
// Find timezoneOffset
121-
int timezoneOffset = (int)((cstDatetime - utcDatetime).TotalMinutes);
122+
// Find timezoneOffset/datetimeReference
123+
int offset = (int)((cstDatetime - utcDatetime).TotalMinutes);
122124
```
123125

124126
## Next steps

0 commit comments

Comments
 (0)