Forum Discussion

Haiyangwhu's avatar
Haiyangwhu
Contributor
11 years ago

date value in log file

Hi there,



My test failed to generate tcLog file due to timed out. I can see logs in such files

"{6E93C2D4-1806-42E7-8CB1-1E94FF6F63B1}", and the logs are in such format:




<Node name="message 58">


<Prp name="date" type="D" value="41733.4472398264"/>


<Prp name="message" type="S" value="The execution timeout has expired."/>

...

</Node>



The date value is less obvious to me. How can i change it to one that i'm familiar with in date/hour/minute/second format?



Thanks,

Ocean

2 Replies

  • This is serial date format described here http://www.cpearson.com/excel/datetime.htm



    Simple transformation can be performed directly in Excel: copy the value to a cell, click right mouse button, select "format cell" and change it to date format.



    Sample function for transformation in TC:




     var serialDateTime = 41733.4472398264;  


     Log.Message( new Date( new Date( 1900, 0, -1,0,0,0,0 ).getTime() + serialDateTime * 86400000 ) );



    // 86400000 = milliseconds in day ( 24 * 3600 * 1000 )



    Result is 04/04/2014 10:44:01


  • function dataValueInLogFile(){


     


      Log.Message(aqDateTime.Now());


      //Result "14/04/2014 16:16:22"


      


    }