I am having a problem with _ftime. It is not returning the correct values for timezone and dstflag in the _timeb structure. Here is an example:
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <sys\timeb.h>
void waitkey(void);
int main(void)
{
struct _timeb tmb;
_ftime(&tmb);
printf("\n");
printf("Seconds: %d \n", tmb.time);
printf("Milliseconds: %hu \n", tmb.millitm);
printf("UTC Offset: %hd minutes \n", tmb.timezone);
printf("Daylight Time: ");
if(tmb.dstflag == 0)
{
printf("False \n");
}
else if(tmb.dstflag > 0)
{
printf("True \n");
}
else // tmb.dstflag < 0
{
printf("Unknown \n");
}
waitkey();
return(0);
}
void waitkey(void)
{
printf("\nPress any key to continue...");
_getch();
printf("\n");
}
timezone is 16996, it should be 480.
dstflag is -1 (Unknown), it should be 0 (False).
I am using Pelle's C headers and libraries.
Thanks,