Author: babymonsta | Posted on: 11/9/2009 10:34:04 PM | Views : 535

Is there a way to write the datetime to check the current time and if assuming its currently 1.30PM I want it to add 30mins to the datetime and then pass it as a parameter.
Because I have a cache code which runs every 60minutes but I actually what to write the datetime to be starting at 1pm, 2pm, 3pm exactly. Because by just writing DateTime.AddMinutes(60) it may run at assuming 1.10PM and then the next time it runs will be 2.10PM, hence my email scheduling which I fix for sending at 2pm will be sent late.
Here's my cache code
private void RegisterCacheEntry() { if (null != HttpContext.Current.Cache[DummyCacheItemKey]) return; HttpContext.Current.Cache.Add(DummyCacheItemKey, "Test", null, DateTime.Now.AddMinutes(60), TimeSpan.Zero, CacheItemPriority.NotRemovable, new CacheItemRemovedCallback(CacheItemRemovedCallback)); }
Im nt s ...

Go to the complete details ...