Accepted answer

i believe all you need to do is format/consider for utc. highcharts default is utc (0). ( if you change to this:

function appendads(date1) {
   alert(new date(date1).toutcstring());
   $('#tabletitle').html("<u>info for " + timeconverter(date1) + ":</u>");


you will see that it shows correct date with that "toutcstring()" added. you will likely want to convert it to something more pleasant to read, but remember that you will have to keep utc in mind if you don't use "toutcstring()".

update: i wanted to explain that i used "toutcstring()" since it was quick and something i knew off the top of my head. this method wouldn't work for all things, such as further down in your appendads function since it is a string. to explain utc and date formatting, parsing and manipulation in full would be too much for this post. but i will try to go over a few key points when dealing with dates on the web. also, please see mdn for other date info (

if you need accurate information and/or logic for dates, you will need to know the date format you get (from server, database, etc...) - whether it is utc or not, for example. then you need to consider if it needs to be manipulated for display (such as for the viewers browser's timezone). and finally, if that date is being used internally, you need to consider if, when, and where you need to convert it once again (as appropriate).

Related Query

More Query from same tag