esper - Nesper engine/C#: issue in internal current time -


i'm using nesper engine (http://www.espertech.com/esper/nesper.php) in c# , i'm facing issue.

when trying retrieve engine's internal time, date returned seems wrong date of yesterday.

the code below dummy sample reproduced problem. understand 'enginetime' , 'datetime.utcnow' should equal, not case.

using com.espertech.esper.client; using system;  namespace nesperdate_bug {     class program     {                 static void main(string[] args)         {             epserviceprovider _espersvc = epserviceprovidermanager.getprovider("test", new configuration());              datetime enginetime = nesper2datetime(_espersvc.epruntime.currenttime);              console.writeline("esper engine time:\t" + enginetime);             console.writeline("system utc time:\t" + datetime.utcnow);             console.readkey();         }          private static datetime nesper2datetime(long millisec)         {             return new datetime(millisec * 10000);         }     } } 

the result i'm getting in console is:

esper engine time:    16/09/2017 10:30:25 system utc time:      17/09/2017 10:30:25 

is problem coming nesper, or 'nesper2datetime' function wrong?

thanks help

after looking @ nesper' source code, appears 'nesper2datetime' function wrong. works when using nesper's 'datetimehelper.utcfrommillis' function.

the following

using com.espertech.esper.compat; datetime enginetime = datetimehelper.utcfrommillis(_espersvc.epruntime.currenttime); 

returns correct date.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -