Lines Matching refs:datetime
0 /* datetime.c - Module for common datetime function. */
20 #include <grub/datetime.h>
35 grub_get_weekday (struct grub_datetime *datetime)
39 a = (14 - datetime->month) / 12;
40 y = datetime->year - a;
41 m = datetime->month + 12 * a - 2;
43 return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7;
47 grub_get_weekday_name (struct grub_datetime *datetime)
49 return _ (grub_weekday_names[grub_get_weekday (datetime)]);
60 grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime)
74 datetime->year = 1973 + 4 * div;
81 datetime->year += 3;
86 datetime->year += nix / SECPERYEAR;
90 && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0
92 nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0
94 datetime->month = i + 1;
95 datetime->day = 1 + (nix / SECPERDAY);
97 datetime->hour = (nix / SECPERHOUR);
99 datetime->minute = nix / SECPERMIN;
100 datetime->second = nix % SECPERMIN;