mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
.
This commit is contained in:
parent
d8b888e732
commit
8c80bcf9f0
10 changed files with 52 additions and 15 deletions
|
@ -39,6 +39,9 @@ add_days_to_timestamp( u32 stamp, u16 days )
|
|||
return stamp + days*86400L;
|
||||
}
|
||||
|
||||
/****************
|
||||
* Note: this function returns GMT
|
||||
*/
|
||||
const char *
|
||||
strtimestamp( u32 stamp )
|
||||
{
|
||||
|
@ -52,6 +55,26 @@ strtimestamp( u32 stamp )
|
|||
return buffer;
|
||||
}
|
||||
|
||||
/****************
|
||||
* Note: this function returns local time
|
||||
*/
|
||||
const char *
|
||||
asctimestamp( u32 stamp )
|
||||
{
|
||||
static char buffer[30];
|
||||
struct tm *tp;
|
||||
time_t atime = stamp;
|
||||
|
||||
tp = localtime( &atime );
|
||||
#ifdef HAVE_STRFTIME
|
||||
mem2str( buffer, asctime(tp), DIM(buffer) );
|
||||
#else
|
||||
strftime( buffer, DIM(buffer)-1, "%c", tp );
|
||||
buffer[DIM(buffer)-1] = 0;
|
||||
#endif
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/****************
|
||||
* Print a string to FP, but filter all control characters out.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue