in reply to Re: Re: Time sorting please help
in thread Need help sorting timestamps

It appears to be doing what you told it to do, not what you want it to do. :)

I think you did the trunc, which probably made it a string, then sorted. If you look at the results, they are sorted as if the timestamp is a string.

Why not sort on the whole (date/time) thing, which Oracle will do correctly, then in your Perl code do the truncating/formatting.