Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Function PBMain() As Long
Local udtUTCST AS SYSTEMTIME
DIM aszDate As AsciiZ * 32
DIM aszTime As AsciiZ * 32
DIM udtLocalST AS SYSTEMTIME
SystemTimeToTzSpecificLocalTime ByVal %NULL, udtUTCST, udtLocalST
GETDATEFORMAT ByVal %NULL, %DATE_SHORTDATE, udtLocalST, ByVal %NULL, aszDate, SIZEOF( aszDate )
GETTIMEFORMAT ByVal %NULL, 0, udtLocalST, ByVal %NULL, aszTime, SIZEOF( aszTime )
? aszDate + " " + aszTime
Local t AS IPOWERTIME
t = CLASS "PowerTime"
Local strTemp As String
Local tempDirData AS DIRDATA
strTemp = DIR$("time.txt", TO tempDirData)
t.Filetime = tempDirData.LastWriteTime
t.ToLocalTime
? t.DateString & " " & t.TimeString
? t.DateString & " " & t.TimeString24 & ":" & FORMAT$(t.second,"00")
? t.DateStringLong & " " & t.TimeStringFull
? t.DateStringLong & " " & LEFT$(t.TimeStringFull,-4)
End Function
'gbs_00619
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm