Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear sir,


How to calculate time in LINQ for current datetime?

for example,

in my table field Data is
Time:
17:30
12:45
20:00


now i calculate my current time with this above time,
Example:Current Time is:23.30.

now i calculate above data,
23:30 - 17:30 = 6:00 hours remaining
23:30 - 12:45 = 10:45 hours remaining
23:30 - 20:00 = 3:30 Hours Remaining
How to possible How to calculate remaining hours

Please reply me.

By mohan
Posted

Linq is not a tool for everything and isn't a programming language in itself. Sometimes you need to just use C#
 
Share this answer
 
Dear Mohan,

If you want to calculate intermediate values in a linq expression, see the
C#
let
element of the linq syntax.

Cheers

Andi
 
Share this answer
 
v2
Comments
Mohankumar.Engain 6-Jan-12 3:55am    
please give me.

How to use LET method in LINQ.

any tutorial or site then inform me

By mohan
Andreas Gieriet 6-Jan-12 5:30am    
Hey, are you lazy or what?

google: linq let c# tutorial

E.g. Walkthrough: Writing Queries in C# (LINQ)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900