Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2bedf6d09e761f959d074fb6021dfb9c374c1cab1061de6cd6d6041f0bd44f48
Ticket: cd25761979da7be2861f124c41956cb0f9945ca4
clock command - "now" vs "-now"
User & Date: sebres on 2024-07-26 19:02:29
Changes

  1. icomment:
    The new clock engine introduces new pseudo seconds value as quasi "option" `-now`, as a replacement for `[clock seconds]` supplied as a base.
    
    This is also described in the TIP.
    
    `clock scan now` is a free-scan form (without format) what was always able to parse "word" `now`... this has indirectly nothing to do with the `-now` "option" (which is normally applicable for `clock format` or `clock add`).
    
    `clock scan` always uses base `-now` by default, but it can be surely supplied with `-base` parameter additionally (although doesn't make sense, because as already said by default it is now):
    
    ```
    % clock scan "+1 month" -base -now
    1724623200
    % clock scan "+1 month"
    1724623200
    % clock scan "now +1 month"
    1724623200
    % clock scan "tomorrow +1 month"
    1724709600
    ```
    
    Just note that only free-scan form of `clock scan` accepts `now` (or `tomorrow` or whatever).
    
    Anyway both have nothing to do with each others (one is a base value to format, add etc, another is a user input to scan).
    
    <blockquote>> Afaict, “-now” is really a value, not an option.</blockquote>
    
    Well, matter of taste probably. One can consider it as an option so that then commands `clock add` and `clock format` don't need a value (value becomes optional in that case).
    
    However, I'm not against can to treat `now` and `-now` as synonyms (no idea it'd need a TIP again). But please without further deprecation of `-now`.
    
  2. login: "sebres"
  3. mimetype: "text/x-markdown"