I'm really confused about correctly displaying historical data:
What i have:
What i need:
I'm hoping for some kind of guide that will explain to me what steps i have to take to achieve all of this. Thank you!
Define two variables in your client-side code:
var startTime = moment().startOf('day').utc().format();
var untilTime = moment().add(1, 'day').startOf('day').utc().format();
You now have the range for your query in terms of UTC. Send them to the server via form post or whatever mechanism you have, then run the query.
When you query, use a half-open range: recordTime >= startTime AND recordTime < untilTime
When you bring the results back down to the client, you will have them in terms of UTC, so convert to local time like so:
moment.utc(theData).local().format()
Adjust input/output format as desired.