🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Ron Sawyer Thu, 28 Sep 2006 13:18
Converting LARGE_INTEGER to Date/Time
#3079
Author: Ron Sawyer
Date: Thu, 28 Sep 2006 13:18
11 lines
1235 bytes
I am writing a custom GINA.  The portion that I am dealing with 
deals with password expiration.  The MSV1_0_INTERACTIVE_PROFILE 
has a data member that is a LARGE_INTEGER called 
PasswordMustChange.  The help file says:

Time and date when the user must change the password. If the user
 can never change the password, this member is undefined. This is
 an absolute-format, Windows, standard time value. 

I cannot find any documentation on converting this.  Can anyone point me in the right direction?
Re: Converting LARGE_INTEGER to Date/Time
#3080
Author: Ed Mulroy
Date: Thu, 28 Sep 2006 13:30
20 lines
1767 bytes
Just a guess but I would expect the time to be expressed as a FILETIME 
structure.  Both FILETIME and LARGE_INTEGER contain two 4 byte numbers.  Try 
using a cast to FILETIME.

.  Ed

> Ron Sawyer wrote in message
> news:451bcbac$1@newsgroups.borland.com...
>
> I am writing a custom GINA.  The portion that I am dealing with
> deals with password expiration.  The MSV1_0_INTERACTIVE_PROFILE
> has a data member that is a LARGE_INTEGER called
> PasswordMustChange.  The help file says:
>
> Time and date when the user must change the password. If the user
> can never change the password, this member is undefined. This is
> an absolute-format, Windows, standard time value.
>
> I cannot find any documentation on converting this.  Can anyone point
> me in the right direction?
Re: Converting LARGE_INTEGER to Date/Time
#3081
Author: Ron Sawyer
Date: Thu, 28 Sep 2006 14:48
24 lines
1826 bytes
From that hint it turns out to be rather simple.  For those who may want to see the solution:

CSCDate::CSCDate(LARGE_INTEGER PassedLargeInt)
{
	FILETIME LclFileTime;
	LclFileTime.dwHighDateTime = PassedLargeInt.HighPart;
	LclFileTime.dwLowDateTime = PassedLargeInt.LowPart;
	FileTimeToSystemTime(&LclFileTime, &MyTime);
}

This gives me a reasonable date (although not the one I was expecting, I now have to go check my data. I was expecting 9-29-2006 and got back 11-9-2006. Again, for those looking for this solution, if I don't post back, assume that the data matches)

I had read an article that seemed to imply (or I misunderstood) that the two dates were different.  

Thanks for the help!

"Ed Mulroy" <dont_email_me@bitbuc.ket> wrote:
>Just a guess but I would expect the time to be expressed as a FILETIME 
>structure.  Both FILETIME and LARGE_INTEGER contain two 4 byte numbers.  Try 
>using a cast to FILETIME.
>
>.  Ed
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads