1

is there any way to print date and time for each log in canoe ??? example: right now for me its printing like below

"8754.876831   CAN 1   AAA   YYYY   CAN Frame    Tx     8     8             00 00 00 00 00 00 00 00"

i would like to have like below

"09 OCT 2017 14:17:23.853 CAN 1   AAA   YYYY   CAN Frame    Tx     8     8             00 00 00 00 00 00 00 00"

is there any way to print like above in canoe ????

Harshan.B
  • 93
  • 5
  • 13

1 Answers1

2

Try this:

on key 'l'
{
  long tm[9];

  getLocalTime(tm);

  write("seconds:%d minutes:%d hours:%d day:%d month:%d year:%d",tm[0],tm[1],tm[2],tm[3],tm[4]+1,tm[5]+1900);
}
AEL
  • 36
  • 2
  • 1
    Hi AEL, welcome to SO! It might be a good idea to explain your answer so that newcomers to the language and ideas you have expressed here who stumble on to your answer will find it easier to understand. It's also more likely to get your answer noticed and praised. – Ethan Field Oct 16 '17 at 15:06