|
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. | NEI PREFERITI | .:: | RSS Forum | RSS News | NEWS web | NEWS software | |
| PUBBLICITA' | | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | | CERCA nel FORUM » | |
06-08-2003, 09.36.57 | #1 |
Hero Member
Registrato: 01-04-2003
Loc.: Sardegna
Messaggi: 685
|
problema con le date
utilizzo questo codice : 1)problema su windows 2000 funzione su windows me no come posso fare ? esiste un metodo valido per entrambi gli os? SYSTEMTIME stUTC, stLocal; FileTimeToSystemTime(&hinfo.ftLastWriteTime, &stUTC); SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal); 2)problema devo prendere la data da un campo di un'header del protocollo http (last-modified) mi arriva in questo formato Last-Modified: Wed, 06 Aug 2003 07:09:36 GMT allora il file sta un server web in locale nella macchina la data di ultima modifica è giusta ma l'orario no come devo fare? è indietro di 2ore p.s non mi dite di aggiungere due ore in + ed il gioco è fatto vorrei una soluzione valida nn che devo andare di volta in volta a modificare il codice grazie in C per windows |
06-08-2003, 13.16.32 | #2 |
Gold Member
WT Expert
Registrato: 09-01-2002
Loc.: None of your business
Messaggi: 5.505
|
Dovrebbe funzionare, non vedo perchè non funga.
Prima usi FileTimeToSystemTime e poi SystemTimeToTzSpecificLocalTime. Prova a richiamarli in ordine inverso, oppure dai un'occhiata al codice VB seguente: Codice:
Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Private Type OFSTRUCT cBytes As Byte fFixedDisk As Byte nErrCode As Integer Reserved1 As Integer Reserved2 As Integer szPathName(128) As Byte 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 Const OF_READ = &H0 Private Declare Function GetFileTime Lib "kernel32" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime 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 hObject As Long) As Long Private Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As FILETIME, lpSystemTime As SYSTEMTIME) As Long Private Declare Function FileTimeToLocalFileTime Lib "kernel32" (lpFileTime As FILETIME, lpLocalFileTime As FILETIME) As Long Private Sub Command1_Click() Dim Handle As Long Dim OF As OFSTRUCT Dim Ft1 As FILETIME, Ft2 As FILETIME, SysTime As SYSTEMTIME Handle = OpenFile("Percorso+NomeFile", OF, OF_READ) GetFileTime Handle, Ft1, Ft1, Ft2 FileTimeToLocalFileTime Ft2, Ft1 FileTimeToSystemTime Ft1, SysTime MsgBox "Il file è stato creato il " + Str$(SysTime.wDay) + "/" + LTrim(Str$(SysTime.wMonth)) + "/" + LTrim(Str$(SysTime.wYear)) CloseHandle Handle End Sub |
06-08-2003, 13.22.07 | #3 |
Hero Member
Registrato: 01-04-2003
Loc.: Sardegna
Messaggi: 685
|
lo so anche su msdn dice che è compatibile
ma quando la uso su windowsMe getlasterror mi dice che la funzione non è supportata dal sistema |
Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti) | |
Strumenti discussione | |
|
|
Discussioni simili | ||||
Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
problema internet explorer lentissimo | filo_2k | Internet e Reti locali | 18 | 07-01-2008 08.24.20 |
Problema di comunicazione col masterizzatore | Shumila | Masterizzazione Giochi Games | 4 | 13-09-2007 06.40.31 |
Problema Pinnacle PCTV Pro e periferiche IDE | exion | Hardware e Overclock | 56 | 30-01-2005 10.44.47 |
Problema con la masterizzazione... la colpa è della Audigy!!! Qualche idea??? | LaBrie | Windows 7/Vista/XP/ 2003 | 13 | 31-01-2004 14.28.25 |
Problema di lentezza ma solo certi momenti | Marko | Windows 7/Vista/XP/ 2003 | 3 | 12-09-2003 15.01.19 |