If date_A and date_B are both Date objects then you could compare the time
values. This would account for the time and you wouldn't have to use
ObjectUtil.dateCompare. http://tinyurl.com/yggtdgh

On Mon, Nov 16, 2009 at 2:29 PM, powers <[email protected]> wrote:

>
>
>
> I'm writing a sort compare function to sort by date. The date format is
> YYYY-MM-DD HH:NN:SS. I'm converting the dates, in a string format, to a
> Date objects like so:
>
> DateField.stringToDate(date_A 'YYYY-MM-DD HH:NN:SS');
> DateField.stringToDate(date_B 'YYYY-MM-DD HH:NN:SS');
>
> Then comparing the dates like this:
>
> ObjectUtil.dateCompare(date_A, date_B)
>
> It always returns 0 when the date portion of the two date objects are
> equal,
> but the times are different. Does the ObjectUtil.dateCompare function not
> account for the time?
>
> --
> View this message in context:
> http://old.nabble.com/Comparing-Dates%3A-ObjectUtil.dateCompare-not-working-tp26378917p26378917.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  
>

Reply via email to