I'm trying to display a timeago that a question has been asked in my project. In my database I have a Datetime columns 'listed'. When a user posts a question I insert the question with the UTC DateTime
.
In the client I have both Livestamp.js
and moment.js
to display the timeago the question has been asked.
Code:
var then = moment(listed).unix(); // convert to unix time
and then:
s += "</td><td><span data-livestamp='" + then + "'></span>";
The problem is that it doesn't shows the timeago as intended, more hours back.
Example of returned date string from server:
2015-03-09T09:16:41
I need a way for livestamp to show the timeago considering UTC Time based on the datetime from the server and taking into consideration the local UTC time, but I don't know how to achieve this.
Note: the server doesn't reside in the same location as the clients (visitors), quite obviously.
Using: MySQL, .NET/C# 4.5, jQuery/Javascript