Search Postgresql Archives

JSON / ASP.NET AJAX Dates support in PostgreSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Is there an easy way to convert JSON data containing ASP.NET AJAX Dates into PostgreSQL timestamp?

I have this kind of JSON data:

{
    "PurchaseOrder" : "4500000000",
    "CreationDate" : "\/Date(1672358400000)\/",
    "LastChangeDateTime" : "\/Date(1672692813062+0100)\/"
}

Warning: Note the backslash before the slashes!
According to JSON spec this is valid JSON and used by AJAX Date format.


When loading that data in Firefox, the JSON visualizer shows AJAX Date values as

"/Date(1672358400000)/"

and

"/Date(1672692813062+0100)/"

(without the backslash)

My understanding is that backslash + slash = slash in JSON strings.


How can I load this record into a table defined as:

CREATE TABLE custorder (
    "PurchaseOrder" BIGINT NOT NULL PRIMARY KEY,
    "CreationDate" TIMESTAMP NOT NULL,
    "LastChangeDateTime" TIMESTAMP NOT NULL
)

?


Seb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux