10
Planned

New Tasker function getDateFormatted

Can we please have this as a Tasker function? I guess it's a very common functionality needed by many ambitious projects and if anybody has already the function in his Tasker configuration new imports of projects containing this task as well will fail.

    getDateFormatted (519)
        Run Both Together
        <%par1: epoch time in ms
    %par2: date format, e.g. ww yyyyMMdd hh:mm
    returns: formatted date>
        A1: Anchor 
        A2: Java Function [ Return:dt Class Or Object:Date Function:new {Date} (long) Param:%par1 Param: Param: Param: Param: Param: Param: ] 
        A3: Java Function [ Return:df Class Or Object:SimpleDateFormat Function:new {SimpleDateFormat} (String) Param:%par2 Param: Param: Param: Param: Param: Param: ] 
        A4: Java Function [ Return:%res Class Or Object:df Function:format {String} (Object) Param:dt Param: Param: Param: Param: Param: Param: ] 
        A5: Return [ Value:%res Stop:On ] 
    

3 replies

I think this is an important enough action for it not to be included in Tasker Functions but as a standalone action.

S

Thanks, that'll be even better :)

S

The new function should probably take rather seconds instead of milliseconds as a parameter. I've noticed in most use cases that I had to convert seconds to milliseconds before calling the task.

You can use AutoTools Tasker plugin, there is action Time which offers date formatting, date adding etc.

S

I'd never use in my tasks a plugin if I can achieve the same with 3 lines of Java functions. As it's something frequently needed and making many tasks easier I think this should be a Tasker function out of the box available.