4 #ifndef tools_wroot_date
5 #define tools_wroot_date
24 time_t tloc = ::time(0);
26 struct tm *tp = (tm*)::localtime(&tloc);
29 struct tm *tp = (tm*)::localtime_r(&tloc, &tpa);
31 unsigned int year = tp->tm_year;
32 unsigned int month = tp->tm_mon + 1;
33 unsigned int day = tp->tm_mday;
34 unsigned int hour = tp->tm_hour;
35 unsigned int min = tp->tm_min;
36 unsigned int sec = tp->tm_sec;
37 return ((year-95)<<26 | month<<22 | day<<17 | hour<<12 | min<<6 | sec);