Answer the question
In order to leave comments, you need to log in
How to get the date in this format (php)?
Hello, I need to format the date for Redtail CRM.
CRM requires in this format
Date(-62135568000000-0800)unix time stamp fails.
Answer the question
In order to leave comments, you need to log in
DateTime values are displayed as JSON strings in the form "/Date (700000 +0500)/" where the first number (700000 in the example provided) is the number of milliseconds in the GMT time zone, the regular (non-Daylight savings) time since midnight, 1 January 1970. The number can be negative to represent earlier times. The part that consists of "+0500" in the example is optional and indicates that the time is local, meaning it should be converted to the local time zone on deserialization. If it is missing, the time is deserialized as Utc.
DateTime Wire Format
DateTime values appear as JSON strings in the form of "/Date(700000+0500)/", where the first number (700000 in the example provided) is the number of milliseconds in the GMT time zone, regular (non- daylight savings) time since midnight, January 1, 1970. The number may be negative to represent earlier times. The part that consists of "+0500" in the example is optional and indicates that the time is of the Local kind - that is, should be converted to the local time zone on deserialization. If it is absent, the time is deserialized as Utc. The actual number ("0500" in this example) and its sign (+ or -) are ignored.
When serializing DateTime, Local and Unspecified times are written with an offset, and Utc is written without.
The ASP.NET AJAX client JavaScript code automatically converts such strings into JavaScript DateTime instances. If there are other strings that have a similar form that are not of type DateTime in .NET, they are converted as well.
The conversion only takes place if the "/" characters are escaped (that is, the JSON looks like "\/Date(700000+0500)\/"), and for this reason WCF's JSON encoder (enabled by the WebHttpBinding) always escapes the "/" character.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question