Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Get datetime out of /Date(1451689200000+0100)/

$
0
0

Hi there

I have a SSIS script task that pulls JSON data from an API, and one issue is that the data returned is in the format:

/Date(1451689200000+0100)/

So how do i get a normal data instead ?

this is what i write to the Output0Buffer

Output0Buffer.Date = metric.Date;

And this is the "convert" part

              

//Set jsonString using a stream reader


               

using(StreamReaderreader = newStreamReader(responseStream))

                {

                    jsonString = reader.ReadToEnd().Replace(

"\\","");

                    reader.Close();

                }

 

 

 

               

//Deserialize our JSON


               

JavaScriptSerializersr =newJavaScriptSerializer();

               

//JSON string comes in with a leading and trailing " that need to be removed for parsing to work correctly


               

//The JSON here is serialized weird, normally you would not need this trim


                jsonResponse = sr.Deserialize<

Wage[]>(jsonString.Trim('"'));


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>