T
Tim Cowan
Hi,
In my application I need to compare whether one time is greater than
another. What I am doing right now is taking the current datetime,
formatting as string without the time element, and then appending the time I
want to the date and converting to date.
DateTime dOpen = System.Convert.ToDateTime(now.Date.ToString("MMM dd, yyyy")
+ " " + storeOpen.Hour + ":" + storeOpen.Minute);
Is this the best way or is there another way? I am then comparing dOpen to
DateTime.Now to see if it is more or less. What I want to know is, is the
store open according to the time right now. If current datetime is greater
than dOpen then it is.
Tim
In my application I need to compare whether one time is greater than
another. What I am doing right now is taking the current datetime,
formatting as string without the time element, and then appending the time I
want to the date and converting to date.
DateTime dOpen = System.Convert.ToDateTime(now.Date.ToString("MMM dd, yyyy")
+ " " + storeOpen.Hour + ":" + storeOpen.Minute);
Is this the best way or is there another way? I am then comparing dOpen to
DateTime.Now to see if it is more or less. What I want to know is, is the
store open according to the time right now. If current datetime is greater
than dOpen then it is.
Tim