Click here to Skip to main content
16,019,619 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi everyone,

I have a asp.net web application bulid in 3 layer architechure in c#.

I need to read the client system(whoever using ) date and time stored in the stored proc in database.

please help me in coding.
Posted
Comments
[no name] 29-Nov-12 5:51am    
So you want it from Client Side or from Database ??
msweety 29-Nov-12 5:53am    
i need from client side..(user's system) which is to be inserted in the database.

All events which happen happen in interaction with the server; and the server knows its local time, which should be got using System.DateTime.UtcNow http://msdn.microsoft.com/en-us/library/system.datetime.utcnow.aspx[^]
On client side, you can use JavaScript method Date.getTimezoneOffset to translate UTC time into local time.. See this turorial : http://www.w3schools.com/jsref/jsref_gettimezoneoffset.asp[^]
 
Share this answer
 
Comments
msweety 29-Nov-12 6:12am    
thanks :-)

i really i didnot get how to use it in my 3 layer architechure.

var d = new Date()
var n = d.getTimezoneOffset();
[no name] 29-Nov-12 6:15am    
Acceptance of the solution will be highly appreciated miss .. :)
msweety 29-Nov-12 6:27am    
aceepted :-)

now pls explain how to collbrate that code to my 3 layer architechure...
[no name] 29-Nov-12 6:28am    
what is your problem exactly ??
 
Share this answer
 
Comments
msweety 29-Nov-12 6:03am    
thanks for the speedy response.
i am not using any lalbel to dispaly the date and time i just need to read the system date and time to insert into database.

i hope i am clear :-)
__TR__ 29-Nov-12 6:05am    
What seems to be the problem?

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