AutoTools [Help] Converting time format hh:mma to HH.mm and hh:mm aa

Discussion in 'AutoApps' started by Jarquafelmu, Dec 16, 2016.

  1. Jarquafelmu

    Jarquafelmu New Member

    Joined:
    Dec 16, 2016
    Messages:
    4
    Likes Received:
    0
    I've tried looking at the autotools time tutorials and guides but so far I haven't had much luck figuring out a solution to my problem. I'm hoping you guys can help.

    I'm trying to convert at time with the format of hh:mma (ex. 02:36P) into HH.mm (ex. 14.36) and h:mm aa (ex. 2:36 pm). The first is so that I can use it as a time variable for profiles. The second is so that I can have an easier to read version.

    I can get the current date from %DATE if I need it, but is there a way to convert the time into a new format without needing to do that?

    Regardless, I'm still pretty lost on what I need to do to actually convert the time.

    A thought I had was to combine %DATE and the provided time to create a MM-dd-yyyy hh:mma string, but I don't know what I need to do in order to conver it into seconds.

    Thanks.
     
    Last edited: Dec 16, 2016
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,481
    Likes Received:
    806
    Hi there!
    Can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance
     
  3. Jarquafelmu

    Jarquafelmu New Member

    Joined:
    Dec 16, 2016
    Messages:
    4
    Likes Received:
    0
    Sure Joaomgcd
    Here is a link to the description of the main task.
    I've brute-forced a solution to my problems by taking the time I am given, running it through my own child task to convert it to a "HH.mm" format, tacking the current date and then shoving that into tasker's convert the DateTime into seconds. Doing that I can then use Autotools to convert it to any format I need. I am just really hoping that there is a cleaner way to do this.
    It would be really nice if Autotools conversions could accept date formats other than seconds, if we supplied the format to be used and if only a time is supplied instead of a date then assume today. Maybe it already does and I just don't know how, but this would solve my issues.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,481
    Likes Received:
    806
    Oh, sorry, you're right! I don't know why I didn't add an option to set the date input format :) You can do that though, by using the "Add Time" section and just don't add any time to it.

    Hope this helps!
     

Share This Page