View html:
<span class="utcdatetime">@user.MostRecentTestDate.Value.ToString("M/dd/yyyy hh:mm tt UTC")</span>
View js:
(needs reference to jquery.formatDateTime.js from https://github.com/agschwender/jquery.formatDateTime)
$(".utcdatetime").each(function () {
var utcTime = $(this).html();
var localTime = $.formatDateTime('dd/mm/yy g:ii a', new Date(utcTime))
$(this).html(localTime);
});
参考:
http://stackoverflow.com/questions/6525538/convert-utc-date-time-to-local-date-time-using-javascript
https://github.com/agschwender/jquery.formatDateTime