Expiration of share link does not take into consideration the local time

Steps to reproduce

  1. Create a new share and set the expiration date to '2018-05-13'
  2. The expiration date is stored in database as '2018-05-13 00:00:00'
  3. Your server should be set at timezone 'Europe/Madrid' and php.ini configuration parameter date.timezone set at 'Europe/Madrid' (this timezone is UTC+2)

Expected behaviour

The share link should not be available at 2018-05-13 00:01:00

Actual behaviour

The share link does not expire until 2018-05-13 02:00:00

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache 2.4

Database: Tested with PostgreSQL and MySQL/MariaDB

PHP version: 7.1

ownCloud version: 10.0.6 (stable)

Updated from an older ownCloud or fresh install: Fresh install

Where did you install ownCloud from: Downloaded tarball from owncloud.org

This is a problem inherited from OwnCloud stance of setting the timezone to UTC, whatever the server has been set to.

In Github I have added a new comment to a ticket that reported this same problem but was closed with a proposed solution that does not solve the problem.

The best solution to this problem would be creating a new setting to compare the expiration dates with the correct timezone.

Hey, from what i know mostly users are around here so its probably the best to create a new issue with your suggestion at github and just link to the old issue and this thread here.

Yeah, I did so as a comment in an existing ticket, but there doesn’t seem to be much activity

Did reopen the issue at least. I understand its an annoyance - how important to you feel about it?

For my clients it is a critical issue, they use shared folders in such a way that uploading is allowed only up to a certain time, so timezones are very important for them.

I patched the source with the changes I wrote in my comment, but they are frozen with that version and could not upgrade OwnCloud on their own.

I think its not that recommended to comment on a three year old issue which was already closed back then (who knows if the people in the issue are still around?). That was my thinking and why i had recommended to “create a new issue” previously. :slightly_smiling_face: