1. How to get the servers hour and minute? The actual server, not the in game hour.

    Thanks
     
  2. If you are want to get time from plugin you can call DateTime.Now.
     
  3. date = DateTime.Now errors
    and System.DateTime.Now returns nill
     
  4. DateTime date = DateTime.Now ?
    What is your programming language?
     
  5. Sky = global.TOD_Sky.get_Instance()
    time = Sky.Cycle.DateTime:ToString("HH:mm:ss")

    I got this working
     
  6. Im using LUA
    [DOUBLEPOST=1439232344][/DOUBLEPOST]
    I need real world time, not in game time.
     
  7. ok i got wrong, do u need the time you are whatching on your clock?
    [DOUBLEPOST=1439232917][/DOUBLEPOST]In that case you need the next code:
    local time = time.GetCurrentTime()

    if you want only to have the hours, min and sec u will need to add :ToString("h:mm tt"), so it will be like this:
    local time = time.GetCurrentTime():ToString("h:mm tt")
     
  8. local hou = time.GetCurrentTime():ToString("h:mm")

    Returns the correct minutes but the hour is off by 4 hours, it doesnt match the machine's time. or does it not take in consideration the timezone offset?
     
  9. if you want your local time, add :ToLocalTime()
    local hou = time.GetCurrentTime():ToLocalTime():ToString("h:mm")
     
  10. Solved, thank you very much!
     
  11. Wulf

    Wulf Community Admin