You must Sign In to post a response.
  • Category: Windows

    How to get original date and time even if user change it


    Are you looking for a way to get original date and time even if user change it ? then read this thread to know more about it



    I am working on a windows application. I am using DateTime.Now.ToString("MM/dd/yyyy"); to get the current date. If i change the system date the date returned by DateTime.Now() also changes which is vulnerable.

    Any one has a solution for this? Thanks
  • #753431
    The solution for it can be reading the date time from a web service, which will not depend on your local machine.

    Use any web service which will provide you the Date time. like


    developers.google.com/maps/documentation/timezone/

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #753432
    Windows application always collect values from your client machine, so I don't think there is way to resolve this issue.
    But if you create Limited access user in windows then no one can change the system date and time.
    OR if you take you client machine under domain then user will not allowed to change the system date and time

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #753438
    Hai Kapil,
    In server,the access wont be granted to make the changes.So it wont be updated by anyone.If someone is having admin credentials, they can change the date and time.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #753446
    Hi,
    Then look for the date from database. Just compare the date of the system and database and then show alert saying you are trying to manipulate the date.

    Since this is a windows application it won't be a problem to query the data from database as and when you require to do the comparison.


    Regards,
    Asheej T K

  • #753475
    thanks to all


  • Sign In to post your comments