How to using date time?

using UnityEngine;
using System.Collections;
using System;
public class controller : MonoBehaviour {

DateTime starttime;
DateTime life;
DateTime nowtime;

void Start () {
	starttime = System.DateTime.Now;
	life = starttime.AddSeconds (3);

void Update () {
	nowtime = DateTime.Now;
	if (nowtime == life){
		Debug.Log ("wow");


Why 3seconds after dont run the “wow” message?

You can’t be sure it will be exactly equal as it’s really a time in milliseconds. Instead you need to check whether it is >= and then disable your check when the time has been exceeded.

Because of floating point precision the times will never be exactly equal. You should check if nowtime is more than life instead.