pbek / nextbackup

NextBackup is the simple database backup solutions for your Nextcloud / ownCloud installation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backup Time defaults to UTC (can't get around it in 10.0.4)

dlandon opened this issue · comments

I have had this issue before where the backup file time is UTC. I previously got around this by changing the UTC time in base.php to my local time. Because of the integrity checks in 10.0.4, I can't make this change. How does one set the local time for backups?

The timestamp that php provides is taken for the backups.

See: https://github.com/pbek/ownbackup/blob/develop/service/backupservice.php#L103

You need to configure the timezones in your server's php.ini.
Does that answer your question?

echo date_default_timezone_get();

This script outputs 'America/New York' which us my timezone.

The only way I could fix this in previous versions was to set the timezone in base.php.

I don't know how to help you, ownCloud's own api is used to show the dates: https://github.com/pbek/ownbackup/blob/develop/templates/admin.php#L18

I looked into it further and the backup files are dated properly when they are created, but when I go to the ownCloud webgui Settings->Additional, the time stamp on the backup files is shown in UTC.

the backup files are dated properly when they are created

where did you see that?

The gui uses ownCloud's own method to show dates, I've no clue why it doesn't show the desired date for you.

Am I the only one that sees this issue?

Currently I don't know of anyone but you...

I ran a short test to determine where the time zone problem is occurring. I placed this code in a timezone.php file in the apps/ownbackup/directory
echo date_default_timezone_get();

When I browsed to the file with https://domain/owncloud/apps/ownbackup/timezone.php, the result was my time zone as expected.

When I put this line "echo date_default_timezone_get();" in the backupservice.php, I got the timezone as "UTC". The php.ini timezone is getting lost in the ownbackup app.

Thank you for your tests. Did the timezone get lost in ownbackup (I would wonder where that would happen) or ownCloud in general?

I don't that much about how ownCloud works, but it appears that the timezone set in base.php (UTC) is the default and apps have to determine the local time and adjust. For example, the calendar app has to work in the local time zone. I was told not to change the base.php time zone because ownCloud needs to work in the UTC time zone.

What I did notice is that the file name you use is the UTC time stamp, which is the right way to do it and the file time is adjusted in Linux for the time zone setting. That's why I saw the file time as correct.