Created
July 10, 2012 01:37
-
-
Save lilith/3080465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SetLastModified(DateTime date) | |
{ | |
DateTime utcDate = DateTimeUtil.ConvertToUniversalTime(date); | |
this.UtcSetLastModified(utcDate); | |
} | |
private void UtcSetLastModified(DateTime utcDate) | |
{ | |
utcDate = new DateTime(utcDate.Ticks - utcDate.Ticks % 10000000L); | |
if (utcDate > DateTime.UtcNow) | |
{ | |
throw new ArgumentOutOfRangeException("utcDate"); | |
} | |
if (!this._isLastModifiedSet || utcDate > this._utcLastModified) | |
{ | |
this.Dirtied(); | |
this._utcLastModified = utcDate; | |
this._isLastModifiedSet = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment