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

Using timezones other than UTC #25

Open
JBenPiel opened this issue Sep 16, 2015 · 5 comments
Open

Using timezones other than UTC #25

JBenPiel opened this issue Sep 16, 2015 · 5 comments

Comments

@JBenPiel
Copy link

It would be great if we could set a default timezone other than UTC for this plugin. I'm having to constantly remind people that when creating a periodic tasks that they need to include -7 (MST) when filling out the Next run date.

I believe an improvement to this plugin would be to use the same timezone as the system, or allow the timezone to be set in the plugin.

@GremL1N
Copy link

GremL1N commented Mar 2, 2016

same problem. I have -8 hours timezone. thats uncomfortably always keep it in mind and calculate.

@alexander-sessa
Copy link

Adding Time.zone = User.current.time_zone in app/models/periodictask.rb solve this issue.

@gainskills
Copy link

gainskills commented Jan 2, 2020

Thanks for @alexander-sessa it works for me.

Just in case someone has the question about where the code put, put a note here.

Search 'Time.now' in the plugin folder (the folder should be renamed to 'periodictask')

    now = Time.now
    Time.zone = User.current.time_zone
  def generate_issue(now = Time.now)
    Time.zone = User.current.time_zone
    if project.try(:active?)

@alexander-sessa
Copy link

alexander-sessa commented Jan 3, 2020 via email

@gainskills
Copy link

But your suggestion still works. Thank you for sharing it.

gainskills pushed a commit to gainskills/Redmine-Periodic-Task that referenced this issue Jan 6, 2020
gainskills added a commit to gainskills/Redmine-Periodic-Task that referenced this issue Jan 6, 2020
rkteam added a commit to rkteam/periodictask that referenced this issue Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants