How to get the System Time?

Hello, I want to fetch the System Time in Unity3D, and in my game, the object1 has to greet object2 accordingly(if 8.00 AM, then Good Morning! If 1.00 PM, then Good Afternoon!)

Use System.DateTime.Now.Hour … it’s in 24 hour time so do something like

int sysHour = System.DateTime.Now.Hour;
if(sysHour > 13)
    Debug.Log("Good Afternoon!");
else if(sysHour > 8)
    Debug.Log("Good Morning!");
    Debug.Log("Go to bed!");