On a project recently, I had a database server and a web server with same date but different time. Since I had no rights to do something about that I was´nt able to use DateTime.Now in my web app and getdate() in the database.
I found 3 solutions to this:
1 - Create a view where getdate() is selected, and call it with Linq
2 - Call execute query like this:
DateTime myDate = DataContext.ExecuteQuery<DateTime>("select getdate()").Single;
3 - Create a new function in you´re data context file:
[Function(Name="getdate", IsComposable=true)]public DateTime GetDBServerDate(){ MethodInfo myInfo = MethodBase.GetCurrentMethod() as MethodInfo; return (DateTime)this.ExecuteMethodCall(this, myInfo, null).ReturnValue;}