How to get tomorrow's date and next week's number for use in Tasker Based on this answer I am looking for a way how to get tommorow's date and next week number to use in Tasker app, Run Shell Command.

I have tried: 

date -d '+1 day' +"%Y%m%d" and similar, but still I am getting Error: 1.

In shell emulator I get bad date '+1 day'

Cannot find any android shell commands reference or man.

Some guides recommend using %TIMES variable, but not sure how.
I've figured it out, I had to learn to use Tasker a bit, the solution is a little awkward but it probably should be done this way in Tasker.

The most important variable for such datetime manipulations in Tasker is a global variable %TIMES which contains current time in seconds - so it is a big long integer number.

Adding e.g. 30 days to it means you need to Set variable (with Math on) like this:

%TIMES + (30 * 86400)


Tommorow is: 

%TIMES + (1 * 86400)


The main problem is, that you have to convert the value to a formatted datetime string. As I understood it there is no built in command for that in Tasker.

You need to create JavaScriptlet task step for that and paste there the code from this page:

&lt;TaskerData sr="" dvi="1" tv="4.1b1m"&gt;
    &lt;Task sr="task54"&gt;
        &lt;cdate&gt;1340586441681&lt;/cdate&gt;
        &lt;edate&gt;1369445351826&lt;/edate&gt;
        &lt;id&gt;54&lt;/id&gt;
        &lt;nme&gt;getFormattedDate&lt;/nme&gt;
        &lt;pri&gt;10&lt;/pri&gt;
        &lt;rty&gt;2&lt;/rty&gt;
        &lt;Action sr="act0" ve="3"&gt;
            &lt;code&gt;129&lt;/code&gt;
            &lt;Str sr="arg0" ve="3"&gt;var gsMonthNames = new Array(
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
);

var gsDayNames = new Array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);

var d = new Date(par[0] * 1000);
var f = par[1];

var formatteddate = f.replace(/(yyyy|yy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,
    function($1)
    {
        switch ($1)
        {
        case 'yyyy': return d.getFullYear();
        case 'yy':   return ('0' + d.getFullYear()).slice(-2);
        case 'mmmm': return gsMonthNames[d.getMonth()];
        case 'mmm':  return gsMonthNames[d.getMonth()].slice(0,3);
        case 'mm':   return ('0' + (d.getMonth() + 1)).slice(-2);
        case 'dddd': return gsDayNames[d.getDay()];
        case 'ddd':  return gsDayNames[d.getDay()].slice(0,3);
        case 'dd':   return ('0' + d.getDate()).slice(-2);
        case 'hh':   return ('0' + ((h = d.getHours() % 12) ? h : 12)).slice(-2);
        case 'HH':   return ('0' + d.getHours()).slice(-2);
        case 'nn':   return ('0' + d.getMinutes()).slice(-2);
        case 'ss':   return ('0' + d.getSeconds()).slice(-2);
        case 'a/p':  return d.getHours() &amp;lt; 12 ? 'a' : 'p';
        }
    }
);&lt;/Str&gt;
            &lt;Str sr="arg1" ve="3"&gt;45&lt;/Str&gt;
            &lt;Int sr="arg2" val="1"/&gt;
            &lt;Int sr="arg3" val="45"/&gt;
        &lt;/Action&gt;
        &lt;Action sr="act1" ve="3"&gt;
            &lt;code&gt;126&lt;/code&gt;
            &lt;Str sr="arg0" ve="3"&gt;%formatteddate&lt;/Str&gt;
            &lt;Int sr="arg1" val="1"/&gt;
        &lt;/Action&gt;
    &lt;/Task&gt;
&lt;/TaskerData&gt;


before that Javascriptlet step you insert 2 steps where you set two input variables %par1 (contains datetime in seconds form previous step) and %par2 (contains yyyymmdd - date format).

The formatted date string is available then in %formatteddate variable.



As for getting the next week:


Run Shell date -d +"%Y" to  %year 
Run Shell  date -d +"%V" to %week 
Set variable %week to %week + 1 (Do Maths On)
Set variable %year to %year + 1 (Do Maths On) (If %week &gt; 52)
Set variable %week to 1 (If %week &gt; 52)
The yyyyww.htm of the next week can then be written as %year%week.htm