In VB the following function grabs all files in a directory between certain date range...
I know your not writing in VB, but maybe this will help...
BG
----------------------------------------------
Function GetFileList(folderpath As String)
Dim FileSystemObj, Folder, file, Files
Dim strFileName As String
Dim dtFile As Date
Dim intCounter As Integer
On Error GoTo GetFileList_ErrorHandler
If IsDate(frmMain.txtDateFrom) = False Or IsDate(frmMain.txtDateTo) = False Then
MsgBox ("Please enter a valid date mm/dd/yy"

intCounter = 0
Exit Function
End If
Set FileSystemObj = CreateObject("Scripting.FileSystemObject"

Set Folder = FileSystemObj.GetFolder(folderpath)
Set Files = Folder.Files
intCounter = 0
For Each file In Files
dtFile = Format(file.DateLastModified, "mm/dd/yy"

If dtFile >= frmMain.txtDateFrom And dtFile <= frmMain.txtDateTo And InStr(1, file.Name, ".doc"

Then
strFileName = file.Name
frmMain.lstFileList.AddItem strFileName
intCounter = intCounter + 1
End If
Next
Set FileSystemObj = Nothing
Set Folder = Nothing
Set Files = Nothing
GetFileList = intCounter
Exit Function
GetFileList_ErrorHandler:
Call HandleError(Err.Number, Err.Description, "GetFileList", True) 'Public Error Handler
End
End Function
-------------------------------------------