get a compilation error because I can't use TimeOffset in this context and by looking at YafDateTime I can't really figure out how its used because its always used as "this.TimeOffset"
use the interface IDateTime instead of YafDateTime
Replace it with...
<% var hour = DateTime.UtcNow.Hour + (YafContext.Current.TimeZoneUser / 60);
if (YafContext.Current.DSTUser)
{
if (TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").IsDaylightSavingTime(DateTime.UtcNow + YAF.Core.Services.YafDateTime.TimeOffset))
{
hours += 1;
}
}var hour = DateTime.UtcNow.Hour + (YafContext.Current.TimeZoneUser / 60);
if (YafContext.Current.DSTUser)
{
if (TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").IsDaylightSavingTime(DateTime.UtcNow + YafContext.Current.Get
().TimeOffset))
{
hours += 1;
}
} %>
By the Way can i recommend a better solution to create a Ticking Clock. I use this little jquery plugin
http://www.tcpweb.com.br/JS-Clock/
example
<span id="clock">Error getting time</span>
js sample code...
$(document).ready(function(){
$('#clock').jsclock('<%# YafContext.Current.Get<IDateTime>().FormatTime(DateTime.UtcNow) %>')
});
and of course you need to load the jquery plugin js file.