From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

why does mktime provide different result?

I'm using exactly the same data to initialize 2 struct tm's, but the result given by mktime is different on each case.

 

Code section:

 

  start.tm_year = sYear;
  start.tm_mon = sMonth - 1;
  start.tm_mday = sDay;
  start.tm_hour = sHour;
  start.tm_min = sMinute;
  start.tm_sec = 0;
  start_t = mktime(&start);

 

  stop.tm_year = sYear;
  stop.tm_mon = sMonth - 1;
  stop.tm_mday = sDay;
  stop.tm_hour = sHour;
  stop.tm_min = sMinute;
  stop.tm_sec = 0;
  stop_t = mktime(&stop);

 

 

Result:

 

cvi - error.JPG

0 Kudos
Message 1 of 2
(2,379 Views)

If I look in the manual, there is a field for daylight saving. If you did not initialize it, it can be anything. And the difference would be typical 1 hour.

Succes, Jos

 

0 Kudos
Message 2 of 2
(2,377 Views)