Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dlandon opened this issue Dec 14, 2017 · 12 comments
Open

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

dlandon opened this issue Dec 14, 2017 · 12 comments
Labels

Comments

@dlandon
Copy link

dlandon commented Dec 14, 2017

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?

@pbek pbek added the question label Dec 14, 2017
@pbek
Copy link
Owner

pbek commented Dec 14, 2017

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?

@dlandon
Copy link
Author

dlandon commented Dec 14, 2017

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.

@pbek
Copy link
Owner

pbek commented Dec 14, 2017

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

@dlandon
Copy link
Author

dlandon commented Dec 14, 2017

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.

@pbek
Copy link
Owner

pbek commented Dec 15, 2017

the backup files are dated properly when they are created

where did you see that?

@dlandon
Copy link
Author

dlandon commented Dec 15, 2017 via email

@pbek
Copy link
Owner

pbek commented Dec 15, 2017

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

@dlandon
Copy link
Author

dlandon commented Dec 15, 2017

Am I the only one that sees this issue?

@pbek
Copy link
Owner

pbek commented Dec 16, 2017

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

@dlandon
Copy link
Author

dlandon commented Dec 23, 2017

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.

@pbek
Copy link
Owner

pbek commented Dec 24, 2017

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

@dlandon
Copy link
Author

dlandon commented Dec 24, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants