|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Junior Member
Iscritto dal: Oct 2007
Messaggi: 2
|
C++ come leggere date e orari contenuti in file
Ho un file txt tipo
03/10/2007 15:17:00 03/10/2007 15:18:00 Come posso leggerlo per poi calcolare quanto tempo è intercorso tra le due date? |
![]() |
![]() |
![]() |
#2 |
Member
Iscritto dal: Sep 2001
Messaggi: 181
|
Detto che sei in grado di parserizzare il file, usa la system_call time_t mktime(struct tm *tm)
la struttura tm è cosi' fatta: Codice:
struct tm { int tm_sec; /* seconds */ int tm_min; /* minutes */ int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ int tm_year; /* year */ int tm_wday; /* day of the week */ int tm_yday; /* day in the year */ int tm_isdst; /* daylight saving time */ }; la funzione restituisce il tipo time_t (secondi a partire dal 1/01/1970), ossia un valore assoluto. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 03:56.