1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* card-util.c (card_status): Use isotimestamp and not the

localized asctimestamp to match the timezone used in the key
information.

* miscutil.c (isotimestamp): New.
This commit is contained in:
Werner Koch 2005-03-14 20:41:20 +00:00
parent a043c14d22
commit a177090f37
7 changed files with 77 additions and 4 deletions

View file

@ -1,6 +1,6 @@
/* miscutil.c - miscellaneous utilities
* Copyright (C) 1998, 1999, 2000, 2001, 2003,
* 2004 Free Software Foundation, Inc.
* 2004, 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -137,6 +137,29 @@ strtimestamp( u32 stamp )
return buffer;
}
/****************
* Note: this function returns GMT
*/
const char *
isotimestamp (u32 stamp)
{
static char buffer[25+5];
struct tm *tp;
time_t atime = stamp;
if (atime < 0) {
strcpy (buffer, "????" "-??" "-??" " " "??" ":" "??" ":" "??");
}
else {
tp = gmtime( &atime );
sprintf(buffer,"%04d-%02d-%02d %02d:%02d:%02d",
1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
tp->tm_hour, tp->tm_min, tp->tm_sec);
}
return buffer;
}
/****************
* Note: this function returns local time
*/