HP WBEM Services Software Developer's Kit for HP-UX Provider and Client Developer's Guide A.01

Code Example Showing CIM DateTime Conversion
Appendix C126
information on the CIM DateTime format can be found in the CIM
Specification on the DMTF web site.
#include <time.h>
...
{
...
struct tm *t = localtime(); // localtime() used as an
example
char tmp[26];
sprintf(tmp, "%04d%02d%02d%02d%02d%02d.000000%c%03d",
t->tm_year+1900,
t->tm_mon+1, //HP-UX stores month 0-11
t->tm_mday,
t->tm_hour,
t->tm_min,
t->tm_sec,
(timezone>0)?'-':'+',
labs(timezone/60 - (t->tm_isdst? 60:0)));
CIMDateTime d(tmp);
...
}