Search Unity

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,741
    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