/* datetime.c - Module for common datetime function. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/datetime.h>
static const char *const grub_weekday_names[] =
{
N_("Sunday"),
N_("Monday"),
N_("Tuesday"),
N_("Wednesday"),
N_("Thursday"),
N_("Friday"),
N_("Saturday"),
};
int
{
int a, y, m;
}
const char *
{
}
void
{
int i;
int div;
/* In the period of validity of unixtime all years divisible by 4
are bissextile*/
/* Convenience: let's have 3 consecutive non-bissextile years
at the beginning of the epoch. So count from 1973 instead of 1970 */
/* Transform C divisions and modulos to mathematical ones */
if (nix < 0)
div--;
/* On 31st December of bissextile years 365 days from the beginning
of the year elapsed but year isn't finished yet */
{
}
else
{
nix %= SECPERYEAR;
}
for (i = 0; i < 12
nix %= SECPERHOUR;
}