Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Time Modifiers

fREW wrote:
> Hello amigos,
> Can anyone tell me exactly how the edges work on the time modifiers?
> Example:  When I say ls *(m1) does it give me everything from the past
> 24 hours, or is it everything from June 1st?  Similarly, if I do ls
> *(m-1) is the edge the beginning of of June 1st or is it 24 hours ago?
>  Same with hours.  Is ls *(mh1) start at 4 pm, or is it just whenever
> 60 minutes ago is?

It's the given period before right now; there's no rounding except to
the nearest second, so it's the first answer in the first case, and the
second answer in the second case.

If you want to specify dates and times and are up to date with version
4.3.4, you can use the "age" function as a modifer:

autoload -U age
print *(e:age today now:)             # files modified today
print *(e-age 17:00 now-)             # files modified since 5 pm
print *(e-age yesterday,17:00 now-)   # ... since 5 o'clock yesterday
print *(e-age 2006/12/25 today-)      # ... from last Christmas before today
print *(e-age 1970/01/01 yesterday-)  # ... before yesterday

and so on.  Note that "today" is a specific time, i.e. midnight last

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

Messages sorted by: Reverse Date, Date, Thread, Author