#730 TimeConversions in C# library

Martin Zázvorka Wed 11 Sep 2019

I have tried to use ProjectHaystack library to write data to skysparks and there are some major problems with time conversions.

Data must be written in localTime and right timezone, but skyspark does daylight savings. So i must convert my timestamps manualy by adding utc.baseOffset.

Also i have read in skyspark documentation that writting data over existing records have no guarenteed behavior and i should hisClear before that ... but hisClear is not implemnted so i had to do it like this :

string clearString = "hisRemove(@" + m_SkysparkId + " ,dateTime(" + from.ToString("yyyy-MM-dd,HH:mm:ss") + ")..dateTime(" + to.ToString("yyyy-MM-dd,HH:mm:ss") + "))";

which have to be in localTime because eval does not do daylight savings. Do you have any advice on this ?

Chris Breederveld Thu 12 Sep 2019

Hi Martin,

We have had similar issues which we currently resolved by removing the local offset before sending it to the library. However as it is much nicer to make it work properly in the library, so we have planned (but haven't gotten round to) adding logic to the library to make it work like we want to use it.

If you do have time to create a solution I'm happy to help you do it! The source of the project can be found here: https://bitbucket.org/skyfoundry/haystack-csharp/src If you manage to find a good way to make it work you can create your own fork and submit your fix. Matthew Giannini usually responds timely and will ensure the fix is also made available as a new NuGet package. If you have any issues with using Mercurial (source control system used for this lirbary) or need any other help, please drop me a line.

Login or Signup to reply.