Local Time

Local Time

Messagepar Michael DELIQUE » 05 Nov 2007 à 18:00

Code : Tout sélectionner
Public Function GetLocalTime_API As String
   
%REM
'Variables API pour la fonction GetLocalTime_API
Type SYSTEMTIME
   wYear As Integer
   wMonth As Integer
   wDayOfWeek As Integer
   wDay As Integer
   wHour As Integer
   wMinute As Integer
   wSeconde As Integer
   wMilliseconds As Integer
End Type
Declare Function GetLocalTime Lib "kernel32.dll" Alias "GetLocalTime" (lpSystemTime As SYSTEMTIME) As Integer
%END REM
   
   'Déclaration Variable
   Dim SysTime As SYSTEMTIME
   
   On Error Goto ErreurGetLocalTime_API
   
   GetLocalTime SysTime
   
   GetLocalTime_API = Cstr(SysTime.wDay) + "/" +Trim(Cstr(SysTime.wMonth)) + "/" + Trim(Cstr(SysTime.wYear))_
   + Cstr(SysTime.wHour) + ":" +Trim(Cstr(SysTime.wMinute)) + ":" + Trim(Cstr(SysTime.wSeconde))+ ":" + Trim(Cstr(SysTime.wMilliseconds))
   
   Exit Function
ErreurGetLocalTime_API:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   GetLocalTime_API = ""
   Exit Function
End Function
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers API