From 31a414d453b26ac0d50e16a40e3ff18a9f77613d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 13 Mar 2015 13:44:22 +0100 Subject: [PATCH] listattr: added support for B_TIME_TYPE. --- src/bin/listattr.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bin/listattr.cpp b/src/bin/listattr.cpp index 13e4010828..00e0a19aad 100644 --- a/src/bin/listattr.cpp +++ b/src/bin/listattr.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2004-2015, Axel Dörfler, axeld@pinc-software.de. * Copyright 2002, Ryan Fleet. * * Distributed under the terms of the MIT license. @@ -111,6 +111,15 @@ show_attr_contents(BNode& node, const char* attribute, const attr_info& info) case B_BOOL_TYPE: printf("%d\n", *((unsigned char *)buffer)); break; + case B_TIME_TYPE: + { + char stringBuffer[256]; + struct tm timeInfo; + localtime_r((time_t *)buffer, &timeInfo); + strftime(stringBuffer, sizeof(stringBuffer), "%c", &timeInfo); + printf("%s\n", stringBuffer); + break; + } case B_STRING_TYPE: case B_MIME_STRING_TYPE: case 'MSIG':