Serialize Java Date to .Net Json date format
<p>Writing Android app to interact with already existing .Net API and ran into date serialization problem. I know that .Net Json date format is /Date(timestamp-timezone)/, however even if I format it like this, I still get error: <code>'There was an error deserializing the object of type ShoutsOut.Entities.MobileUser. DateTime content '\/Date(1469457720840-0000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.'</code></p>

<p>Full stack trace:</p>

<pre><code>at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) 
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) 
at System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ReadObject(Message message) 
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters) 
at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters) 
at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) 
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc) 
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) 
</code></pre>

<p>I'm formatting it like this: </p>

<pre><code>public static String toJson(Date date) {
    return "\\/Date(" + date.getTime() + "-0000)\\/";
}
</code></pre>

<p>Tried to:</p>

<ul>
<li>Remove timezone</li>
<li>Remove / /</li>
<li>add ' between the date</li>
</ul>

<p>Found slightly different format <code>"\"\\/Date("+date.getTime+"-0500)\\/\""</code>, didn't work either</p>