function time() { return 3601; } function ago(time) { var df = time() - time; return df; } var t = time(); alert(ago(t));