How to use queries to get list of pages instead of blocks?

I want to have a query block that would contain a list of pages i’ve created during a month in order to add them to my ‘contents’ page and classify them.
the table should look like this:

page title

[[page1]]
[[page2]]

end
i would then take those items by dragging and place into my hierarchical list…
Using “all pages” tab isn’t really convenient for that purpose.
I’m new to Logseq, so i’d like to hear about some other ways to solve similar problem with classification of new pages that can be used

I found how to get list of pages by name
but i need to get all pages created between a given time period
how can i do that?

The issue is that a page’s created time is stored as a UNIX timestamp in the database. So if you need to query pages created between two time periods, then you need to pass both those time periods as UNIX timestamps to it.

#+BEGIN_QUERY
{:title "Pages created between two time periods"
 :query [:find (pull ?p [*]) 
         :in $ ?start ?end
         :where
         [?p :block/name _]
         [?p :block/created-at ?t]
         [(>= ?t ?start)]
         [(<= ?t ?end)]]
 :inputs [1657885810000 1658404210000]}
#+END_QUERY

If you want something automatic, then you can use this query to get a list of pages created in the last 30 days.

#+BEGIN_QUERY
{:title "Pages created past 30 days"
 :query [:find (pull ?p [*]) 
         :in $ ?end
         :where
         [?p :block/name _]
         [?p :block/created-at ?t]
         [(- ?end 2629800000) ?start]
         [(>= ?t ?start)]
         [(< ?t ?end)]]
 :inputs [:end-of-today-ms]}
#+END_QUERY

Hello where can i find this kind of IDs?
I’ve tried the first query, but failed to load anything.
The second one allow me to pull hundreds of result.
So I think there will be something to do with that ID, I guess.
Please help thank you.

Unix timestamps are the number of seconds since January 1st, 1970.

You can use the fact that 1 day = 86400 seconds to calculate any period of time just by multiplying it by the number of days you want.

If you want to convert specific dates, then this unix timestamp site might be helpful.

Any update on this? I have the same issue as the original poster: if I create a daterange of e.g. 7 days or 30 days in unix timestamp milliseconds, it basically just returns all the pages in my graph (over 2000), not just the ones that were created or updated in last 7 or 30 days