[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP.Net date time in other time zones

Posted on 2012-08-21
5
Medium Priority
?
445 Views
Last Modified: 2012-08-21
Hi,

My application is going to be used by users in Europe and the USA. When adding a record to the database I want to record the users local date and time and not the server date and time.

What would be the best approach to accomplish this?

Thanks
0
Comment
Question by:Soluga
  • 2
  • 2
5 Comments
 
LVL 20

Accepted Solution

by:
Rikin Shah earned 2000 total points
ID: 38315402
You can go for javascript date for this.
http://www.w3schools.com/js/js_obj_date.asp
0
 
LVL 1

Author Comment

by:Soluga
ID: 38315407
I am recording the users location in the database when adding a user, so the location can change if the user moves to another country.
0
 
LVL 20

Expert Comment

by:Rikin Shah
ID: 38315424
So you want to capture the current date of the location the page was submitted? Like you said another country?
0
 
LVL 9

Expert Comment

by:teebon
ID: 38315428
Hi Soluga,

You can use DateTimeOffset data type to store your date time, and you can switch the timezone of the data base on the location of the login user.

http://msdn.microsoft.com/en-us/library/bb396765.aspx
0
 
LVL 1

Author Closing Comment

by:Soluga
ID: 38315570
Prob best option, but I will record both server and local times, as the user can change their pc to anytime zone!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question