#600 hisRead: best way to discover the date of yesterday for a site

Tyler B. Long Wed 28 Mar 2018

Example setup:

There is a hs client application needing to perform hisReads on a group of points with a range of several days for each point. The client is in the EDT time zone and the site is in AEDT. At the time of execution, the site's yesterday date is the same as the client's today date. The client needs a way to discover the date "yesterday" or "today" (without performing an initial hisRead) for each site. The purpose being the ability to formulate date ranges to query which are appropriate for each site prior to the hisRead op being performed.

Question:

With the limitation of the hs client not being able to perform the hisRead op, is there a simple way to get the date associated with yesterday or today for a given site?

Thanks,

Tyler

Brian Frank Thu 29 Mar 2018

You can query the timezone of the server from the about operation.

You can query the timezone of a site or point via a read and look at the tz tag.

But in the end, hisReads should be relative to the point's timezone. Timezones are nasty, but necessary.

Tyler B. Long Thu 29 Mar 2018

Thank you for the feedback Brian. The values for the tz tag appear to be a partial IANA format (e.g. tz=Chicago). The hs client app being dealt with is written against .net which needs the windows based IDs. Chicago would then translate to Central Standard Time. I've found libraries that would perform the IANA->Windows conversion but they require the full IANA format.

The main goal was to try and limit how many hisRead requests were performed against a single id. The simple solution, at the expense of more requests, is to perform a hisRead for range=yesterday and grab the hisStart value for the date of yesterday. Then perform additional hisRead ops as needed. Fortunately this situation only applies to points recorded on a COV basis.

Login or Signup to reply.