Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Using Real World Time

Discussion in 'Scripting' started by JonnyDoeInWisco, Mar 26, 2015.

  1. JonnyDoeInWisco

    JonnyDoeInWisco

    Joined:
    Jun 2, 2014
    Posts:
    22
    Im making an app that requires the use of real world time. I realize there is probably a function for this but I obviously am not looking in the right places to find out what they are. So I'm wondering what the best approach would be here. I want to let the user pick times for a click event to happen, so say at 3:15 pm it would click on given mouseX and mouseY points.
     
  2. Kogar

    Kogar

    Joined:
    Jun 27, 2013
    Posts:
    80
  3. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,739
    you done need a background service to simply get the time, that is useles overhead.
    Code (csharp):
    1. System.DateTime.Now
    will return a DateTime object that can get what you need.
     
  4. Kogar

    Kogar

    Joined:
    Jun 27, 2013
    Posts:
    80