Input is from sql with DateAndTime formatted as type datetime.
If I can't reformat it maybe I can truncate the field 9-char from left.
The slect statement is:
var t = "SELECT DateAndTime, Time, Temperature, Humidity, BarrPress FROM weather_1 GROUP BY DATE(DateAndTime), HOUR(DateAndTime) ORDER by DateAndTime DESC limit " + myMsg
You could probably do it in you sql query,. you do not state what DB you are using.
Most DB's will have a date format function e.g. MySQL DATE_FORMAT() Function
You can also use AS syntax to assign a clean name to the returned formatted date e.g. SQL AS
var t = "SELECT DATE_FORMAT(DateAndTime,'%M %D %Y'), date, Time, Temperature, Humidity, BarrPress FROM `weather_1` GROUP BY Date, HOUR(Date) ORDER by Date DESC LIMIT " + myMsg
The results are great(Thanks) however that column of the table is not populated.
My payload is:
var t = "SELECT DATE_FORMAT(DateAndTime,'%M %D %Y'), date, Time, Temperature, Humidity, BarrPress FROM `weather_1` GROUP BY Date, HOUR(Date) ORDER by Date DESC LIMIT " + myMsg
Minor change
DATE_FORMAT(DateAndTIME,%M %D %Y) as newDate
Them modified the column for newDate.
Works Great thanks.