-
May 28th, 2011, 04:07 PM
#1
datetime
I am looking into some WMI class, there are properties of type "datetime"
class win32_something
{
//...
datetime dt;
//..
};
What type is that 'datetime' equivalent to in C library ?
Thank you
-
May 28th, 2011, 04:59 PM
#2
Re: datetime
Well, I never used WMI but according to its documentation (http://msdn.microsoft.com/en-us/libr...37(VS.85).aspx) the datetime is formatted as:
yyyymmddHHMMSS.mmmmmmsUUU
I guess there is no any "equivalent" in C library but you could format such a value using sprintf or some similar function.
How are you going to use this "'datetime' equivalent to in C library"?
Victor Nijegorodov
-
May 29th, 2011, 04:19 PM
#3
Re: datetime
Hi, thanks for your reply
Here is my code I try to read Win32_OperatingSystem's install data
pClassObject->Get(L"InstallDate",0, &vtProp, CIM_EMPTY, 0);
BSTR str=vtProp.bstrVal;
ISWbemDatetime*o;
//Create o's instance
o->putval(str);
// do somethingelse
While debygging I sse the value of str is something like
{aaaa-aaaa-zzz-eeee-eeeee}
What happens ?
I expect a time format string from Get method as you mentioned though.
-
May 30th, 2011, 02:29 PM
#4
Re: datetime
I have no idea where you have got such a value from (and how!) - it looks almost like a GUID value except the lenthes of fields you supplied are not correct...
Anyway you could also look at this MSDN site.
Victor Nijegorodov
-
May 31st, 2011, 04:08 PM
#5
Re: datetime
The InstallDate property in win32_operatingsystem is of type datetime, I am thinking the Get method from classobject pointer should result a string of double type indicating the date and time of the installation. Yes, it results in an odd GUID string.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|