Re: Format and compare time
You can use DateTime.Compare method.
.Compare returns an integer value: -1 for less than, 0 for equal, and 1 for greater than if you just want a quick check rather than specific amounts of minutes or hours.
Re: Format and compare time
Scroll down to Post #14 in this thread.
Re: Format and compare time
There could be an issue is 11:27 pm before or after your time? What if that time (11:27 pm) was last night of 3 days ago was that before the current time?
Re: Format and compare time
the day doesnt matter, I only want to know if the current time is prior, equal, or beyond the input string in the format of "1.35pm" or "10.50am". I'll try the suggesstions and wirte back,
Cheers
Re: Format and compare time
thanks that compare function was just what I needed.
The second thing I need is a function to convert this time format:
11.50am or 3.05pm or 9.10am
to this:
11:50 or 15:05 or 9:10
Like i said it can be done by extracting the mins, hours, pm and am, but I was hoping there would be a function like Format() that could do it