Ne volim kad ljudi traže da im se baš potpuno sve uradi, al' ajde...
' POTREBAN JE TEXTBOX Text1 i Command button Command2
Option Explicit
Option Compare Database
Private Const OFS_MAXPATHNAME = 128
Private Const OF_READWRITE = &H2
Private Type OFSTRUCT
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName(0 To OFS_MAXPATHNAME - 1) As Byte
End Type
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Declare Function SetFileTime Lib "kernel32" _
(ByVal hFile As Long, _
lpCreationTime As FILETIME, _
lpLastAccessTime As FILETIME, _
lpLastWriteTime As FILETIME) As Long
Private Declare Function SystemTimeToFileTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME, _
lpFileTime As FILETIME) As Long
Private Declare Function OpenFile Lib "kernel32" _
(ByVal lpFileName As String, _
lpReOpenBuff As OFSTRUCT, _
ByVal wStyle As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hFile As Long) As Long
Private Sub Command2_Click()
ChangeFTime (text1)
End Sub
Private Sub ChangeFTime(fName As String)
Dim hFile As Long
Dim tmp As String
Dim OFS As OFSTRUCT
Dim SYS_TIME As SYSTEMTIME
Dim NEW_TIME As FILETIME
' OVDE UKUCAVAŠ ŽELJENI DATUM
SYS_TIME.wYear = 2007
SYS_TIME.wDay = 11
SYS_TIME.wMonth = 4
hFile = OpenFile(fName, OFS, OF_READWRITE)
Call SystemTimeToFileTime(SYS_TIME, NEW_TIME)
Call SetFileTime(hFile, NEW_TIME, NEW_TIME, NEW_TIME)
Call CloseHandle(hFile)
End Sub
Ozbiljan i odgovoran mladić