blob: ce9e8661aae9e4b01e8f709eaf1ea5d3aad072f2 [file] [log] [blame]
/*
* crtdef.c
*
* C Run-Time Libraries functions definitions
* implimentation file
*
* Copyright (C) knightray@gmail.com
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include "crtdef.h"
void
Getcurtime(tffs_sys_time_t * ptime)
{
#if(0)
time_t rawtime;
struct tm * curtm;
time(&rawtime);
curtm = localtime(&rawtime);
(ptime)->tm_sec = curtm->tm_sec;
(ptime)->tm_min = curtm->tm_min;
(ptime)->tm_hour = curtm->tm_hour;
(ptime)->tm_mday = curtm->tm_mday;
(ptime)->tm_mon = curtm->tm_mon;
(ptime)->tm_year = curtm->tm_year;
#else
/* Marvell fixed: no RTC in uboot for now */
memset((void*)ptime, 0, sizeof(*ptime));
(ptime)->tm_hour = 1;
(ptime)->tm_mday = 1;
(ptime)->tm_year = (80 + 35); /* (1900+80)+35 = 2015*/
#endif
}