I've got the following code being pulled from SQL Server with Linq:
UserList = (from u in userQuery
select new UserViewModel
{
{...}
LastUpdate = u.LastUpdate,
{...}
}).AsQueryable();
I put in a breakpoint and see the correct datetime that's getting pulled down and it is in my local timezone.
This is sent up to the view via JSON:
<tr>
<td>Last Updated</td>
<td>
<div data-bind="text: SelectedUser().LastUpdate" class="detailFields"></div>
</td>
</tr>
But now the datetime is showing as "GMT" instead of my local time.
Where am I going wrong?
Updated code:
Installed moment.js, imported and changed the line to:
<div data-bind="text: moment(SelectedUser().LastUpdate()).format('LLL')" class="detailFields"></div>
NOTE the () after the LastUpdate variable name...