I have a time_t and Struct tm being used in my code. I am not able to initiaize the struct tm like the way i am doing. If this is initialized in the function then it works fine. Please help
#include "time.h"
static struct tm strtime;
struct tm * timeinfo;
time_t startTime;
time_t endTime;
time_t curTime;
time_t candleStartTime;
strtime.tm_hour = 9; //Error here
strtime.tm_min = 15; //Error here
strtime.tm_sec = 00; //Error here
void PrintMarketData(void **args,nsString sPfName)
{
curTime = time (NULL);
timeinfo = localtime (&curTime);
int curYear = timeinfo->tm_year;
int curMonth = timeinfo->tm_mon;
int curDay = timeinfo->tm_mday;
strtime.tm_year = curYear;
strtime.tm_mon = curMonth;
strtime.tm_mday = curDay;
}