Get DateTime according to country.
-
Hello, I have hosted my website on server is lying in USA. I have used system.Datetime.Now() for date operations, whereas my clients are from india and it shows me around 12 hours difference. How can i map this time zone? I don't want to store the client's machine time but only server end time. Please help me. waiting for your prompt reply. Thanks.
-
Hello, I have hosted my website on server is lying in USA. I have used system.Datetime.Now() for date operations, whereas my clients are from india and it shows me around 12 hours difference. How can i map this time zone? I don't want to store the client's machine time but only server end time. Please help me. waiting for your prompt reply. Thanks.
hi, You can use
DateTime.Now.ToUniversalTime()
-
hi, You can use
DateTime.Now.ToUniversalTime()
Thanks for your reply sir. DateTime.Now.ToUniversalTime() returns UTC datetime. How can i get the india's datetime from this. Please help me.
-
Thanks for your reply sir. DateTime.Now.ToUniversalTime() returns UTC datetime. How can i get the india's datetime from this. Please help me.
hi, Please refer to the link below http://forums.asp.net/p/813670/813709.aspx[^]
-
hi, Please refer to the link below http://forums.asp.net/p/813670/813709.aspx[^]
hello, i have referred that link but i am not able to get exact idea from it.
-
Hello, I have hosted my website on server is lying in USA. I have used system.Datetime.Now() for date operations, whereas my clients are from india and it shows me around 12 hours difference. How can i map this time zone? I don't want to store the client's machine time but only server end time. Please help me. waiting for your prompt reply. Thanks.
You can Convert the date time from us format to indian format by converting to utc and adding the hrs. OR Use Javascript to get the client time
var localTime = new Date();
var hours = localTime .getHours();
var minutes = localTime .getMinutes();
var seconds = localTime .getSeconds();I think It can be done using culture i never used it try the below link similar post..! http://relatedterms.com/thread/1394580/Date%20%20%20Time%20issues%20with%20different%20timezones%20for%20server%20%20%20client[^]
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.