Assigning data and time to FILETIME structure in C++
<p>In windows and in C++. I have following code.</p>

<pre><code>typedef struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME, *PFILETIME, *LPFILETIME;

struct DateTime
{
    unsigned int dwLowDateTime;
    unsigned int dwHighDateTime;
};

FILETIME ftTime;
GetSystemTimeAsFileTime(&amp;ftTime);

DateTime myTime;
myTime.dwHighDateTime = (unsigned int)ftTime.dwHighDateTime;
myTime.dwLowDateTime  = (unsigned int)ftTime.dwLowDateTime;
</code></pre>

<p>Now I have requirement to assign values like</p>

<pre><code>2012-06-25 12:00:10.123
</code></pre>

<p>to "myTime" or ftTime.</p>

<p>How can I achive this?</p>

<p>Another question is how can I get number of seconds elapsed like 64-bit integer for date "2012-06-25 12:00:10.123" ? How do I convert this to __int64 so that I assign to FILETIME?</p>

<p>I have seen in another question post</p>

<pre><code>__int64 t;
FILETIME ft;
ft.dwLowDateTime = (DWORD)t;
ft.dwHighDateTime = (DWORD)(t &gt;&gt; 32);
</code></pre>

<p>I am not supposed to use Boost in my project.</p>

<p>Thanks!</p>
