Re: date Conversion Program in Assembly
- From: "Guga" <mauroteste@xxxxxxxxxxx>
- Date: 31 Aug 2005 08:02:56 -0700
Hi Ninad
Use this function i wrote:
; FILETIME structure
[St_DateTimeStamp:
St_DateTimeStamp.dwLowDateTime: D$ 0
St_DateTimeStamp.dwHighDateTime: D$ 0]
; SYSTEMTIME structure
[St_UTC:
St_UTC.wYear: W$ 0
St_UTC.wMonth: W$ 0
St_UTC.wDayOfWeek: W$ 0
St_UTC.wDay: W$ 0
St_UTC.wHour: W$ 0
St_UTC.wMinute: W$ 0
St_UTC.wSecond: W$ 0
St_UTC.wMilliseconds: W$ 0]
Proc TimeDateStampToString:
Arguments @TimeStamp, @DateFmt, @TimeFmt, @DateOut, @TimeOut
mov eax D@TimeStamp
mov edx &SECS_TO_100NS
mul edx
add eax &EPOCH_DIFF_SECS_INTERVAL_LOW
adc edx &EPOCH_DIFF_SECS_INTERVAL_HIGH
mov D$St_DateTimeStamp.dwLowDateTime eax
mov D$St_DateTimeStamp.dwHighDateTime edx
call 'kernel32.FileTimeToSystemTime' St_DateTimeStamp St_UTC
call 'KERNEL32.GetDateFormatA' &LOCALE_SYSTEM_DEFAULT &NULL
St_UTC D@DateFmt D@DateOut &MAX_UTC_TIME_LEN
call 'KERNEL32.GetTimeFormatA' &LOCALE_SYSTEM_DEFAULT &NULL
St_UTC D@TimeFmt D@TimeOut &MAX_UTC_TIME_LEN
EndP
Usage example:
[DataPointer: D$ ?] ; Points to the data that stored the value of the
timedate stamp.
[Sz_Year: B$ "yyyy/MM/dd ddd ",0]
[Sz_Hour: B$ "HH:mm:ss UTC",0]
[szDateString: B$ ? #64] ; Lenght of the date string. (Maximum is
&MAX_UTC_TIME_LEN)
[szTimeString: B$ ? #64] ; Lenght of the time string. (Maximum is
&MAX_UTC_TIME_LEN)
call TimeDateStampToString D$DataPointer Sz_Year Sz_Hour
szDateString szTimeString
Best Regards,
Guga
.
- References:
- date Conversion Program in Assembly
- From: Ninad
- Re: date Conversion Program in Assembly
- From: Dirk Wolfgang Glomp
- date Conversion Program in Assembly
- Prev by Date: Re: f0dder's Fabulous Wait States.
- Previous by thread: Re: date Conversion Program in Assembly
- Index(es):
Relevant Pages
|