Another sorting question 
Author Message
 Another sorting question

How can I quickly sort a string array of dates (without converting to
seconds since 1970) ?


Fri, 21 Nov 2003 05:57:41 GMT  
 Another sorting question

Quote:

>How can I quickly sort a string array of dates (without converting to
>seconds since 1970) ?

Converting to seconds ?? Never heared about it...

Date Format:
YEAR-MONTH-DAY

2001-06-04
2000-03-28
1956-12-23
0500-01-17

Its really easy to sort this dates -
think about it.

cya,
...Dan



Fri, 21 Nov 2003 06:54:06 GMT  
 Another sorting question


Quote:


>>How can I quickly sort a string array of dates (without converting to
>>seconds since 1970) ?

>Converting to seconds ?? Never heared about it...

>Date Format:
>YEAR-MONTH-DAY

>2001-06-04
>2000-03-28
>1956-12-23
>0500-01-17

>Its really easy to sort this dates -
>think about it.

Hi,

  If your/the dates are stored in YYYY-MM-DD format already then sorting can
be done quite quickly using ARRAY SORT !however! if they need to be converted
first to YYYY-MM-DD and then back agian then conversion to Days since
0001-01-01 and back should quicker.

  In fact, I always store my dates a integers for this purpose. If you'll tell
me which powerbasic you're using I'll post code for you (all).

--
C'ya,

  Don Schullian
www.DASoftVSS.com
www.basicguru.com



Sat, 22 Nov 2003 21:40:21 GMT  
 Another sorting question
That's my problem. they're stored in a different format read straight in
from a CSV file.
I'm using PBDLL6
thanks,
Richard


Quote:
> On Mon, 4 Jun 2001 00:54:06 +0200, "Danilo Krahn"


Quote:


> >>How can I quickly sort a string array of dates (without converting to
> >>seconds since 1970) ?

> >Converting to seconds ?? Never heared about it...

> >Date Format:
> >YEAR-MONTH-DAY

> >2001-06-04
> >2000-03-28
> >1956-12-23
> >0500-01-17

> >Its really easy to sort this dates -
> >think about it.

> Hi,

>   If your/the dates are stored in YYYY-MM-DD format already then sorting
can
> be done quite quickly using ARRAY SORT !however! if they need to be
converted
> first to YYYY-MM-DD and then back agian then conversion to Days since
> 0001-01-01 and back should quicker.

>   In fact, I always store my dates a integers for this purpose. If you'll
tell
> me which PowerBASIC you're using I'll post code for you (all).

> --
> C'ya,

>   Don Schullian
> www.DASoftVSS.com
> www.basicguru.com




Sun, 23 Nov 2003 06:54:33 GMT  
 Another sorting question

Quote:

>That's my problem. they're stored in a different format read straight in
>from a CSV file.
>I'm using PBDLL6
>thanks,
>Richard

Attached (sorry about that but the lines were wrapping) are the 2 files
required. You'll need to break the dates down in to their seperate elements
for Y, M, and D.

--
C'ya,

  Don Schullian
www.DASoftVSS.com
www.basicguru.com



Sun, 23 Nov 2003 13:54:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Listbox sorting question

2. CW2003 Browse Sort Question

3. newbie locale/ascii sort question

4. Sort Question

5. sort question

6. Sort Question

7. Homework: Sorting Question

8. Sort question

9. a sorting question...

10. sorting question

11. list sort question

12. List sorting question

 

 
Powered by phpBB® Forum Software