Convert Time to Hours in Excel


I’ve found myself having to convert time in Excel stored as hours, minutes, seconds (e.g. 3:42:09) into hours in decimal format (e.g. 3.70) for invoicing my time and every month I end up googling this.

The method I use is a formula in Excel using the Excel Time functions (HOUR, MINUTE, and SECOND).


Replace CELL with the appropriate cell in your Excel workbook (e.g. A2).


Solution to HTTP 400 Bad Request when POSTing to WCF RESTful web service


Here’s the first post.  While this first post on my iPhone development blog has nothing to do with the iPhone, it’s something that I’d like to share with you all as it took me a few hours to get this one totally figured out.

The first post I’ll share is a scenario of a problem I was having with communicating with a RESTful WCF service. For some reason all I was getting back from the service was an HTTP 400 – Bad Request response when attempting to make a POST to a url.

So, here’s what I was attempting to do.  I created a simple WCF RESTful web service.  This web service will be used for all the communication between the iPhone’s and my server.

I created a simple method defined as follows:

Looks strait forward enough.  This definition means that the method will respond to POST actions against the url /users.  The RequestFormat is XML and the ResponseFormat is XML.  The message format of the body of the request is Bare, meaning that it will just contain the raw XML.

Ok, now that the method is defined and I waived some magic under the hood of the interface definition to do something with the request.  I bring up my trusty HTTP application to send some requests to the service and see what happens.  (the trusty HTTP app I was using if you were wondering is: HTTP Client).  Now, I spin up and send some requests to the service.

Firstly, you need to make sure that you specify the content type and a couple other headers needed for the requests.



That’s it, end of story, Go to Jail, Do Not Pass Go!!  WCF does not give you any error messages, nothing, NADA!  How do you figure out what’s wrong?

I spent a lot of time searching on the web, trying to find out, is it an error in definition of the method in the service, is it hitting the service at all, put a breakpoint in the service, nothing.  The error is being thrown by the WCF runtime, so what gives??  What’s the real error?

After trying everything I could think of I did the one thing that actually makes sense.  I went into my application, and wrote a UNIT TEST.  I started from the beginning, create valid XML representing the DataContract object I want to send through the WCF service.

Voila, problem solved!  The problem turned out to be that I wasn’t specifying the namespace on the XML representation of the object I was sending in the body of the POST message!!  Now, why couldn’t WCF have told me that?  Why not give me a friendly error message in the response (I have the setting enabled to show full error details in the WCF XML configuration in the web.config file).


Just include the namespace on the XML object I was sending in the body of the request.  So, with the added namespace(xmlns=“” xmlns:i=“”) Everything just worked again!

Here’s the working Request and Response.  Note the namespace now specified on the XML in the body: