0
votes

How to convert oracle datetime to javascript datetime format with in the query ?

I tried to look at the oracle documentation but I was not able to find what I was looking for ?

I am trying to pull data for a time series chart similar to below fiddle but pulling the data from oralce database in json format.

http://www.highcharts.com/demo/spline-irregular-time

In the above demo, date is created using Date.UTC(1970, 9, 27)

I am getting the data using json.

    $.getJSON('data.json', function(data) {
    options.series[0].data = data;
    var chart = new Highcharts.Chart(options);
});

I can't seem to find a way to get UTC format(milliseconds from 01 January, 1970 00:00:00 Universal Time (UTC)) from oracle database.

2
Parsing values to generate a Date is fairly straight forward, what is the format of the string you get from the database?RobG
As far as I searched, there is no way to get the date as UTC time stamp. We have to do it using what ever programming language that we are using, after getting the date from the database.xenres

2 Answers

0
votes

Use Oracle function to_char and get date format that you need

0
votes

As far as I searched, there is no way to get the date as UTC time stamp from oracle db. We have to do it using what ever programming language that we are using, after getting the date from the database.