It's not trivial, but fortunately gmtime and mktime exist already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>