From: Ralph Boehme Date: Thu, 5 Dec 2019 14:26:07 +0000 (+0100) Subject: s3:lib: add pull_long_date_full_timespec() X-Git-Tag: ldb-2.1.0~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8c9559847503f20cf87f1dbe353ee7d9796ad64;p=thirdparty%2Fsamba.git s3:lib: add pull_long_date_full_timespec() BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/include/proto.h b/source3/include/proto.h index 992c7462316..583814ea1bc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -290,6 +290,7 @@ void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct t void put_long_date_full_timespec(enum timestamp_set_resolution res, char *p, const struct timespec *ts); +struct timespec pull_long_date_full_timespec(const char *p); void put_long_date(char *p, time_t t); void dos_filetime_timespec(struct timespec *tsp); time_t make_unix_date(const void *date_ptr, int zone_offset); diff --git a/source3/lib/time.c b/source3/lib/time.c index a5882f3d8ff..a1b0c781401 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -183,6 +183,13 @@ void put_long_date_full_timespec(enum timestamp_set_resolution res, SBVAL(p, 0, nt); } +struct timespec pull_long_date_full_timespec(const char *p) +{ + NTTIME nt = BVAL(p, 0); + + return nt_time_to_full_timespec(nt); +} + void put_long_date(char *p, time_t t) { struct timespec ts;