ASP.Net date time in other time zones

Posted on 2012-08-21
Last Modified: 2012-08-21

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?

Question by:Soluga
    LVL 19

    Accepted Solution

    You can go for javascript date for this.
    LVL 1

    Author Comment

    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.
    LVL 19

    Expert Comment

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

    Expert Comment

    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.
    LVL 1

    Author Closing Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now