Fix date encoding on 32 bit systems