hook_cron() function is using incorrect date calculation.
Table 'weather_forecasts' field 'time_to' is using local time, not UTC, so why check for current UTC time?

Patch attached.

CommentFileSizeAuthor
#1 cron_utc_time-2315743.patch682 bytesrudins
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rudins’s picture

FileSize
682 bytes

  • toddy committed f38f60c on 7.x-2.x
    #2315743: Fix an error in cron check for outdated forecasts
    
toddy’s picture

Assigned: Unassigned » toddy
Status: Needs review » Fixed

Thanks for the bug report, this is fixed in the latest release. Although I did not use exactly your patch, because the local time (of the computer, not the location of the forecast) would be equally wrong. I've now settled to calculate yesterday in UTC time, that should even catch the western timezones which are some hours behind UTC.

Regards,
Tobias

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.