Arduino stops logging data after ~32761 seconds
Instead of comparing absolute times you should use the following:

unsigned long now = millis();

if(now - time_last_log &gt;= freq){
    logCount += 1;
    LastLoggedDate=date;
    DataLogg(date);
    time_last_log = now; 
    // or if you really want fixed intervals
    // time_last_log += freq; 
}


This is guaranteed to be overflow proof.