diff options
author | Werner Koch <[email protected]> | 2016-06-28 13:45:53 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-06-28 13:53:59 +0000 |
commit | 1ddf5b846fc058171af5f2784dad866b73eb0205 (patch) | |
tree | 4298df7be9dd465cd659ca633c854cb4ca09a034 /common/gettime.h | |
parent | common: Add missing header file for clarity. (diff) | |
download | gnupg-1ddf5b846fc058171af5f2784dad866b73eb0205.tar.gz gnupg-1ddf5b846fc058171af5f2784dad866b73eb0205.zip |
common: New function rfctimestamp.
* common/gettime.c (rfctimestamp): New.
--
It is surprisingly hard to create an RFC-2822 compliant Date value.
The problem is that strftime uses the current locale but the RFC
requires that the English names are used. This code is pretty simply
and avoid the extra problem of figuring out the correct timezone;
instead UTC is used. For the planned use case this is anyway better.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/gettime.h')
-rw-r--r-- | common/gettime.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/gettime.h b/common/gettime.h index cbc257ada..08cb3b176 100644 --- a/common/gettime.h +++ b/common/gettime.h @@ -59,6 +59,7 @@ const char *strtimevalue (u32 stamp); const char *strtimestamp (u32 stamp); /* GMT */ const char *isotimestamp (u32 stamp); /* GMT */ const char *asctimestamp (u32 stamp); /* localized */ +char *rfctimestamp (u32 stamp); /* RFC format, malloced. */ gpg_error_t add_seconds_to_isotime (gnupg_isotime_t atime, int nseconds); gpg_error_t add_days_to_isotime (gnupg_isotime_t atime, int ndays); gpg_error_t check_isotime (const gnupg_isotime_t atime); |