mtdowling / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/
MIT License
4.89k stars 339 forks source link

timezone handling #32

Closed DerManoMann closed 10 years ago

DerManoMann commented 11 years ago

Is there any reason to set the timezone in getRunDate() if a properly configured $curentTime is set? I need to validate cronlines against different timezones and it would be nice if timezone is only set if the provided $currentTime is null.

Nice code otherwise :)

mtdowling commented 11 years ago

Hm. I don't remember why I set the timezone there. Maybe it should only set the timezone if the DateTime object is created by the method (and not passed in).

DerManoMann commented 11 years ago

Exactly my thoughts. Is that something you could just do or do you want a PR for that?