What type of date/time format is this? - json

I'm currently attempting to use HighStock charts on my site. I'll be using a PHP file to generate the data for the chart, my only question is what date/time format does HighStock use? Here's an example file they have on their site: http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json
[1107129600000,38.45]
Above is a line of data in the json file where 1107129600000 is the date and 38.45 is the stock price. Hopefully someone will know the date/time type. Thanks.

It looks like a UNIX timestamp. It's the number of seconds(or in your case, milliseconds) since January 1 1970. Most programming languages will let you convert this into more natural date/time formats.
Here's a tool to help you convert to see for yourself: http://www.epochconverter.com/
Further reference: http://en.wikipedia.org/wiki/Unix_time

Related

Why aren't timeUnits working in this example?

I opened a thread yesterday asking how I should be encoding dates and times. It was suggested that the datetime object would be a good format, as in 'have the least issues'. Here's an example where date time doesn't seem to be working.
Can anyone help me understand why? I've noted an increasing tendency of Vega-Lite examples to use ISO-8601, and in fact if I change this example to use that format it works. So this is more of a 'why isn't it working with datetime'. Is this format still recommended? Does it still even work?
Apologies but I think I misled you with my comment on the other thread (now deleted). Date time objects are only used for filter transform, scale domain, and axis/legend values. I have looked through all the sample json files for Vega Lite and can find no example of specifying a data object like you do in your sample.
Instead, if you specify you data as follows, you don't need to provide a format object.
{"entity": "Wildfire", "date": "2022-10-01", "deaths": 75}

How to convert a string into json format in flink side?

I received a one digit as string format, for example, which look like 12.
What I want to do is to convert those strings into a json format and
write them to the text file in my local directory.
However, I didn't get the right solution except for those things that manually change the strings so that it looks like the json format. I think it is tedious and laborious tasks.
The completed json format will be shown as below.
{"temperature": 12}
Is there any libraries that achieve my issue?
Thanks.
Check out Gson. In particular, if you have a Java class with a single "temperature" field, then see this for how to convert to Json.

Data type for storing date time offset in golang

I am using go language to develop an application. In my program I receive a JSON data which contains an entity in date time offset format for example DateTime": "2014-10-19T23:08:24Z"
I need to unmarshal the JSON and store it in the database in the TIMESTAMP(p) WITH TIME ZONE format in PostgreSQL database. When I unmarshal, I need to store this in a variable of the same data type.
Is there a data type available in Golang to do this or any other means of doing this?
The time.Time struct is aware of the timezone, and should be properly handled by most of the SQL drivers available.
The only thing to add is that the convention in most systems is to use only UTC dates in exchange formats (JSON, SQL, etc) and let the application shift to timezone when necessary.

Can we use custom JSON Data on Cubism?

I saw the cubism graphs and they are simply amazing. I have a big JSON file with 1000 entries that have a timestamp and a value (integer). Can Cubism graph those or not?! I can't seem to find documentation on this...
Cubism is generally intended for realtime data, but you can implement a metric that simply returns static values from a JSON file. Typically you do this by using context.metric. See the stocks demo in the Cubism intro talk for an example.

Name of month serialized local specific

according to the coldfusion docs SerializeJSON converts Dates to strings which can easily be parsed by JavaScript Date objects.
I just serialized a query and JavaScript could not parse the Date columns because the name of the month was serialized local specfic returning Mai, what is not understood by JavaScript. Javascript only accepts english month names. Do I now - as I just did - have to replace the local specific month name manually with it's english translation to easily parse the string to a JavaScript Date object?
Best,
Bernhard
You could try and deal with this on the server by using setLocale('en_us') to force English language versions of your query when serialised - not ideal but it might get the job done. I think this can be set per request. See info here: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fa3.html
Hope that helps.
This answer to another question suggests that perhaps you could use datejs and then use the appropriate localization to parse your strings natively rather than in English.
I have a solution
In the coldfusion administrator add this -Duser.language=en -Duser.region=US to the JVM agruments. (And restart the service) You tell the JVM engine not to use the machine locale but to use the 'normal' english locale.
When you use SerializeJSON after the change it will generate dates with the enlish month names.
I haven't found any unwanted side effects with this change.