How to handle the discrepancy in precision between .NET CLR DateTime and datetime in SQL Server (and SQL CE) -


in .net datetime data type precision 100ns. in sql server , sql ce datetime type not precise .

i have tons of code uses datetime.now or datetime.utcnow. values returned calls stored in database. depending on value, when pull data out of database, not match entered value. result unit tests fail , business logic relies on comparisson fails

this has common problem. have go everywhere in code see datetime.utcnow or datetime.now , round down? if that, have prevent future references datetime.now , datetime.utcnow. there way prevent that?

are there other standard approaches?

thanks


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -