If CONFIG_LIBC_LOCALTIME or CONFIG_TIME_EXTENDED are defined, then the NSH date command should also show the day ofo the week

This commit is contained in:
Gregory Nutt 2015-11-25 12:52:36 -06:00
parent e910671474
commit 882ae41aee

View File

@ -108,7 +108,11 @@ static inline int date_month(FAR const char *abbrev)
#ifndef CONFIG_NSH_DISABLE_DATE #ifndef CONFIG_NSH_DISABLE_DATE
static inline int date_showtime(FAR struct nsh_vtbl_s *vtbl, FAR const char *name) static inline int date_showtime(FAR struct nsh_vtbl_s *vtbl, FAR const char *name)
{ {
#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
static const char format[] = "%a, %b %d %H:%M:%S %Y";
#else
static const char format[] = "%b %d %H:%M:%S %Y"; static const char format[] = "%b %d %H:%M:%S %Y";
#endif
struct timespec ts; struct timespec ts;
struct tm tm; struct tm tm;
char timbuf[MAX_TIME_STRING]; char timbuf[MAX_TIME_STRING];