summaryrefslogtreecommitdiffstats
path: root/tools/ideviceimagemounter.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ideviceimagemounter.c')
-rw-r--r--tools/ideviceimagemounter.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c
index 3fb4ac5..b4512f5 100644
--- a/tools/ideviceimagemounter.c
+++ b/tools/ideviceimagemounter.c
@@ -28,8 +28,9 @@
28#include <string.h> 28#include <string.h>
29#include <getopt.h> 29#include <getopt.h>
30#include <errno.h> 30#include <errno.h>
31#include <glib.h>
32#include <libgen.h> 31#include <libgen.h>
32#include <time.h>
33#include <sys/time.h>
33 34
34#include <libimobiledevice/libimobiledevice.h> 35#include <libimobiledevice/libimobiledevice.h>
35#include <libimobiledevice/lockdown.h> 36#include <libimobiledevice/lockdown.h>
@@ -165,7 +166,7 @@ static void plist_node_to_string(plist_t node)
165 double d; 166 double d;
166 uint8_t b; 167 uint8_t b;
167 uint64_t u = 0; 168 uint64_t u = 0;
168 GTimeVal tv = { 0, 0 }; 169 struct timeval tv = { 0, 0 };
169 170
170 plist_type t; 171 plist_type t;
171 172
@@ -214,9 +215,23 @@ static void plist_node_to_string(plist_t node)
214 215
215 case PLIST_DATE: 216 case PLIST_DATE:
216 plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec); 217 plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec);
217 s = g_time_val_to_iso8601(&tv); 218 {
218 printf("%s\n", s); 219 time_t ti = (time_t)tv.tv_sec;
219 free(s); 220 struct tm *btime = localtime(&ti);
221 if (btime) {
222 s = (char*)malloc(24);
223 memset(s, 0, 24);
224 if (strftime(s, 24, "%Y-%m-%dT%H:%M:%SZ", btime) <= 0) {
225 free (s);
226 s = NULL;
227 }
228 }
229 }
230 if (s) {
231 puts(s);
232 free(s);
233 }
234 puts("\n");
220 break; 235 break;
221 236
222 case PLIST_ARRAY: 237 case PLIST_ARRAY: