Page MenuHomePhabricator

Module clock is still showing previous day date
Open, NormalPublic

Description

Hi,

Every day, between 00:00 local time and 01:00, the clock module is showing previous day date as current date.
Screnshot:

Enlightenment version: 0.20.5

Thanks

beber created this task.Sep 15 2016, 1:22 PM
beber updated the task description. (Show Details)Sep 17 2016, 4:59 PM
ProhtMeyhet triaged this task as Normal priority.EditedOct 14 2016, 3:22 PM
ProhtMeyhet assigned this task to zmike.
ProhtMeyhet added a subscriber: ProhtMeyhet.

i can't reproduce, except for the date change only occures on 12:00:01 not on 12:00:00. since you report exactly 1 hour, it sounds very much related to the used timezone.

a quick look and i'm not sure if i am right, shouldn't this use gettimeofday() and localetime() instead of time(NULL)? line 534 in enlightenment/src/modules/clock/e_mod_main.c

520 static Eina_Bool
521 _update_today_timer(void *data EINA_UNUSED)
522 {
523    time_t t, t_tomorrow;
524    const struct tm *now;
525    struct tm today;
526
527    e_int_clock_instances_redo(EINA_TRUE);
528    if (!clock_instances)
529      {
530         update_today = NULL;
531         return EINA_FALSE;
532      }
533
534    t = time(NULL);
535    now = localtime(&t);
536    memcpy(&today, now, sizeof(today));
537    today.tm_sec = 1;
538    today.tm_min = 0;
539    today.tm_hour = 0;
540
541    t_tomorrow = mktime(&today) + 24 * 60 * 60;
542    if (update_today) ecore_timer_interval_set(update_today, t_tomorrow - t);
543    else update_today = ecore_timer_add(t_tomorrow - t, _update_today_timer, NULL);
544    return EINA_TRUE;
545 }