1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Expiration time works (I hope so)

This commit is contained in:
Werner Koch 1998-11-20 17:42:18 +00:00
parent f9d2bd8cb9
commit 47c61bafe3
35 changed files with 7147 additions and 2848 deletions

View file

@ -1,3 +1,7 @@
Thu Nov 19 07:09:55 1998 Werner Koch <werner.koch@guug.de>
* miscutil.c (strtimevalue): New.
Tue Nov 10 10:01:53 1998 Werner Koch (wk@isil.d.shuttle.de)
* strgutil.c (set_native_charset): New.

View file

@ -39,6 +39,35 @@ add_days_to_timestamp( u32 stamp, u16 days )
return stamp + days*86400L;
}
/****************
* Return a string with a time value in the form: x Y, n D, n H
*/
const char *
strtimevalue( u32 value )
{
static char buffer[30];
unsigned int years, days, hours, minutes;
value /= 60;
minutes = value % 60;
value /= 60;
hours = value % 24;
value /= 24;
days = value % 365;
value /= 365;
years = value;
sprintf(buffer,"%uy%ud%uh%um", years, days, hours, minutes );
if( years )
return buffer;
if( days )
return strchr( buffer, 'y' ) + 1;
return strchr( buffer, 'd' ) + 1;
}
/****************
* Note: this function returns GMT
*/