mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Expiration time works (I hope so)
This commit is contained in:
parent
f9d2bd8cb9
commit
47c61bafe3
35 changed files with 7147 additions and 2848 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue