Warning: session_start(): open(/var/lib/php/sessions/sess_5f3pga68kulqkk3l17c965sbtt, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass BackupFileAge {
// minutes (last group) are optional
settable S pattern = "^(.*)\\.backup(2\\d\\d\\d)(\\d\\d)(\\d\\d)-(\\d\\d)(\\d*)$";
settable S fileName;
settable TimeZone timeZone = defaultTimeZone();
settable long currentTime = now();
S originalName;
int year;
int month;
int day;
int hour;
int minute;
long time;
double ageInDays;
bool parse() {
var pat = regexp(pattern);
var matcher = pat.matcher(fileName);
if (!matcher.find()) false;
originalName = matcher.group(1);
year = matcherInt(matcher, 2);
month = matcherInt(matcher, 3);
day = matcherInt(matcher, 4);
hour = matcherInt(matcher, 5);
minute = matcherInt(matcher, 6);
time = timestampFromYMDHM(year, month, day, hour, minute, timeZone);
ageInDays = ((currentTime-time)/1000.0/60/60/24;
true;
}
}