0

Need some help with this script. When I run this script it works well. However, at the end of the day it freezes at evening. The following day when I run the script it starts at evening, and it should start by saying morning. Am I missing something?

string timeOfDay;

dialog getTimeOfDay (out string TOD) {
			string time = formatDate(now(), "HHmm");
			if (time =~ '(?:[0-1]) (?:[0-1]) (?:[0-5]) (?:[0-9])'){
					TOD = "morning";
			}//Closes Morning String
			elif (time =~ '(?:1) (?:[2-6]) (?:[-5]) (?:[0-9])') {
					TOD = "afternoon";
			}//Closes Afternoon String
			else TOD = "evening";

call getTimeOfDay(out timeOfDay);
string timeOfDay;

dialog getTimeOfDay (out string TOD) {
			string time = formatDate(now(), "HHmm");
			if (time =~ '(?:[0-1]) (?:[0-1]) (?:[0-5]) (?:[0-9])'){
					TOD = "morning";
			}//Closes Morning String
			elif (time =~ '(?:1) (?:[2-6]) (?:[-5]) (?:[0-9])') {
					TOD = "afternoon";
			}//Closes Afternoon String
			else TOD = "evening";

call getTimeOfDay(out timeOfDay);
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ezzaral
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.