Thanks Daniel Figured that was the case, shame they do any changes to the date/times, if they just displayed them assuming they were UTC I could get it right on the server end and that would just work.
Jules On Thursday, 9 April 2015 15:10:40 UTC+1, Daniel LaLiberte wrote: > > Jules, > > If you send the data to the browser using a Date format, then you would > have to figure out what the browser did with it in order to undo the local > time adjustment, so, yes, it would probably be simpler to send the data in > some other format, and then convert to dates knowing exactly what you are > doing in the conversion. It might be best to construct a new DataTable or > DataView rather than try to replace the dates as some other value (e.g. > milliseconds) to actual 'date' type objects. > > You might want to try an experiment by sending the data in 'timeofday' > format. This is an array of values, e.g. [18, 45, 27, 123], that should > now allow the year, month, and day values in addition to the hour, minute, > second, and millisecond values. This may allow you to use the values more > directly in a Date constructor. > > > On Thu, Apr 9, 2015 at 9:28 AM, Julian Blundell <[email protected] > <javascript:>> wrote: > >> Hi Daniel >> >> Thanks for the pointers. >> >> I am getting the data by json and using the Date() format as specified. >> >> Originally I was sending up a local time for the sensor, however the >> routines assume that it is a UTC time and helpfully add on daylight saving >> time etc. so I reverted to UTC and have been trying to find a decent >> solution ever since. >> >> Am I right in assuming you are suggesting sending up the data in some >> other format and preprocessing it to trick the graphs into showing the >> correct times since the javascript time/date functions won't let me specify >> the time zone either. >> >> Jules >> >> On Thursday, 9 April 2015 14:08:57 UTC+1, Daniel LaLiberte wrote: >>> >>> Julian, >>> >>> You will have to use the JavaScript date constructor with Date.UTC() to >>> specify the correct time. See the documentation on: >>> https://developers.google.com/chart/interactive/docs/datesandtimes >>> >>> This won't work if you need to use the JSON representation for your >>> data, however. If you do, then you'll have to do some post-processing of >>> the data in the browser. >>> >>> On Thu, Apr 9, 2015 at 7:47 AM, Julian Blundell <[email protected]> >>> wrote: >>> >>>> Hi >>>> >>>> I am logging physical data from sensor boxes located, potentially, all >>>> over the world. >>>> >>>> The data is sent to the graphs as UTC date using the Date(date params) >>>> with another column holding the sensor data. >>>> >>>> Data that is logged at 12 midnight in New York must always be displayed >>>> as being collected at that time no matter where the user happens to be >>>> located. >>>> >>>> The time zone for the data display is currently taken from the users >>>> browser so if they are viewing the data in London the time for that piece >>>> of data would be 5am and in Hong Kong something like 12pm. >>>> >>>> Could we have a way of setting the time zone other than passing the >>>> time zone for the users browser back to the server and hacking the data >>>> being sent up? >>>> >>>> Regards >>>> >>>> Julian Blundell >>>> >>>> >>>> >>> >>> -- >>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> >>> - 978-394-1058 >>> [email protected] 5CC, Cambridge MA >>> [email protected] 9 Juniper Ridge Road, Acton MA >>> >> -- >> > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > - 978-394-1058 > [email protected] <javascript:> 5CC, Cambridge MA > [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
