How do you get the current time in MASM? i have looked in win32.hlp. i found GetCurrentTime, but all it says is that it is obsolete and to use GetTickCount instead. I have used this before and all it does is tell you how many milliseconds windoes has been running. So how do i get the time? thanks. skud.
Posted on 2001-05-09 14:36:00 by skud
Hi, GetLocalTime PROTO :DWORD GetDateFormatA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD GetTimeFormatA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD .Data ;==========> API GetLocalTime DateFormatPic db "dd' 'MMM' 'yyyy",0 TimeFormatPic db "HH':'mm':'ss",0 .Data? Buffer db 104h dup(?);buffer align 4 ; - SYSTEMTIME structure - wYear dw ? ;look into Win32.hlp wMonth dw ? wDayOfWeek dw ? wDay dw ? wHour dw ? wMinute dw ? wSecond dw ? wMilliseconds dw ? .Code ;------------------------------------------------------------------------------ ; API "GetLocalTime" retrieves the current local date and time. ;------------------------------------------------------------------------------ push OFFSET wYear ;lpSystemTime, address systemtime struc call GetLocalTime ;- API Function - ;------------------------------------------------------------------------------ ; API "GetDateFormat" formats a date as a date string for a specified locale. ; The function formats either a specified date or the local system date. ;------------------------------------------------------------------------------ push 104h ;cchDate, size of buffer push OFFSET Buffer ;lpDateStr, buffer for formatted string push OFFSET DateFormatPic ;lpFormat, date format string push OFFSET wYear ;lpDate, date to be formatted push 0h ;dwFlags, flags specifying function options push 0000h ;Locale, LOCALE_USER_DEFAULT = 0000h call GetDateFormatA ;- API Function - ;------------------------------------------------------------------------------ ; API "GetTimeFormat" formats a time as a time string for a specified locale. ; The function formats either a specified time or the local system time. ;------------------------------------------------------------------------------ push 104h ;cchTime, size in bytes of the buffer push OFFSET Buffer ;lpTimeStr, buffer storing formatted string push OFFSET TimeFormatPic ;lpFormat, time format string push OFFSET wYear ;lpTime, time to be formatted push 8h ;dwFlags, TIME_FORCE24HOURFORMAT = 8h push 0000h ;Locale, LOCALE_USER_DEFAULT = 0000h call GetTimeFormatA ;- API Function - OK ? so long Test
Posted on 2001-05-09 15:46:00 by Test Department
thanks for the response :) skud.
Posted on 2001-05-09 17:05:00 by skud