Local Time Zone Preferences
Windchill REST Services enables the DateTimeOffset properties to appear the same as the preferences that the user sets for user’s local time zone in Windchill. The user’s local time zone preference is shown as a response level annotation and returns the zone ID.
For example if the user’s preference is set to GMT- 6:00 (US Central Time) then the response level annotation is as follows:
"@PTC.AppliedContainerContext.LocalTimeZone" : "America/Chicago"
Container Level Preferences
If you specify the PTC-Container-Context header with a value of a container, then all the DateTimeOffset values that are returned are in the offset based on the container-level preference that is set in Windchill.
If you don’t specify the PTC-Container-Context header with a value of a container then all the DateTimeOffset values returned are in the offset based on a user-level preference lookup of the user.
Querying with the DateTimeOffset Property
The DateTimeOffset property can be used in $filter expressions with a non-UTC offset.
To query both the date and time portion of the DateTimeOffset property you must also specify the custom parameter ptc.search.allowFilterOnTime and set it to true. If you do not specify a value for ptc.search.allowFilterOnTime or set the value to false then the $filter expression returns only the date portion of the DateTimeOffset property.
For example, to view all the parts created on a specific date and at a particular time, set the value of the parameter ptc.search.allowFilterOnTime to trueand use the $filter expression as follows:
/Windchill/servlet/odata/ProdMgmt/Parts?$filter=TimeATT eq 2020-04-30T15:00:00%2B08:00&ptc.search.allowFilterOnTime=True
The response shows the parts with a date of 30th April and a local time of Africa/Cairo (GMT + 2) since the parameter ptc.search.allowFilterOnTimeis True.
这对您有帮助吗?