Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
[metze/samba/wip.git] / source / scripting / python / misc.i
index 19318cdb17b7a56a7bf705db4e1a6397a7297f76..81be7d5c16152799ee54d2ac485558fcbd3f32df 100644 (file)
@@ -106,3 +106,16 @@ bool dsdb_set_ntds_invocation_id(struct ldb_context *ldb, const char *guid)
 char *private_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
                const char *name);
 
+typedef unsigned long time_t;
+
+/*
+  convert from unix time to NT time
+*/
+%inline %{
+uint64_t unix2nttime(time_t t)
+{
+       NTTIME nt;
+       unix_to_nt_time(&nt, t);
+       return (uint64_t)nt;
+}
+%}