* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
* $Author: ekohl $
- * $Date: 2001/07/06 12:50:47 $
+ * $Date: 2001/07/06 21:16:28 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */
* a directory gives 'invalid' times in st_atime etc...
*/
char* asctime (const struct tm* tmsp);
+wchar_t* _wasctime(const struct tm *timeptr);
char* ctime (const time_t* tp);
+wchar_t* _wctime(const time_t * const timep);
struct tm* gmtime (const time_t* tm);
struct tm* localtime (const time_t* tm);
return result;
}
+wchar_t *
+_wasctime(const struct tm *timeptr)
+{
+ static const wchar_t wday_name[DAYSPERWEEK][3] = {
+ L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat"
+ };
+ static const wchar_t mon_name[MONSPERYEAR][3] = {
+ L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun",
+ L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec"
+ };
+ static wchar_t result[26];
+
+ (void)swprintf(result, L"%.3s %.3s%3d %02d:%02d:%02d %d\n",
+ wday_name[timeptr->tm_wday],
+ mon_name[timeptr->tm_mon],
+ timeptr->tm_mday, timeptr->tm_hour,
+ timeptr->tm_min, timeptr->tm_sec,
+ TM_YEAR_BASE + timeptr->tm_year);
+ return result;
+}
+
+
char *
ctime(const time_t * const timep)
{
return asctime(localtime(timep));
}
+wchar_t *
+_wctime(const time_t * const timep)
+{
+ return _wasctime(localtime(timep));
+}
+
/*
** Adapted from code provided by Robert Elz, who writes:
** The "best" way to do mktime I think is based on an idea of Bob