and that works but i need to then convert it to 24hour format so 19:30 not 9:30pm. i've tried variable convert but that doesn't cover this.
i tried instead of changing 2 above from long to medium and on 4 choosing %realtime4 and now i get a proper 24hr clock with the : - 19:30 - yay.
i'll be honest, i've been writing this post (and googling while doing it) since 19:30 and it's now 21:14 and was going to beg for help but seems that this might sort it.
so in spite of that - Pent, please, pretty please can you add a variable that shows time with the colon? as well as the full stop which i've read is needed for something else (altough my mind is a blur right now).
thank you all and a good night ;)
Tom.
- Variable se%realtime to %TIME
- Variable Search Replace %realtime to seconds to long date time
- Variable split
- Say %realtime5
be ok? i haven't tested yet but it gives out a time which is in a 24hr format with a : as a seperator.
On May 8, 2015 3:54 PM, "Juergen Gruen" <androi...@googlemail.com> wrote:
>
> Nice implementation/workaround with a subtask here: http://tasker.wikidot.com/getformatteddate
I would prefer http://developer.android.com/reference/java/text/DateFormat.html which is more flexible and efficient than getformatteddate.
Just an example. I agree, a build-in Tasker solution should use the native API...
Juergen.
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/QeiVku9INe0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
it's a number
You can get the time in 12 hr format with this shell command as well..
date +"%r"
You can get the time in 12 hr format with this shell command as well..
date +"%r"
On May 8, 2015 7:01 PM, "Juergen Gruen" <androi...@googlemail.com> wrote:
>
> ... and I think Date/Time-formatting in Tasker causes way more probs in non-english speaking countries.
This one of the reasons I suggested the DateFormat class. It can automatically adjust its output to the user's locale.
Example:
Test (39)
A1: Variable Set [ Name:%time_ms To:%TIMEMS Do Maths:Off Append:Off ]
A2: Java Function [ Return:time_form Class Or Object:DateFormat Function:getTimeInstance
{DateFormat} (int) Param:3 Param: Param: Param: Param: Param: Param: ]
A3: Java Function [ Return:%time_str Class Or Object:time_form Function:format
{String} (Object) Param:%time_ms Param: Param: Param: Param: Param: Param: ]
A4: Flash [ Text:%time_str Long:Off ]
A5: Java Function [ Return:sdf Class Or Object:SimpleDateFormat Function:new
{SimpleDateFormat} (String) Param:"kk:mm:ss" Param: Param: Param: Param: Param: Param: ]
A6: Java Function [ Return:%time_str Class Or Object:sdf Function:format
{String} (Object) Param:%time_ms Param: Param: Param: Param: Param: Param: ]
A7: Flash [ Text:%time_str Long:Off ]
On May 9, 2015 12:14 AM, "Juergen Gruen" <androi...@googlemail.com> wrote:
> It seems to be a very clumsy way to set a simple" date string. ;-)
I think perhaps you misunderstood. My argument and example were targeted specifically against the suggestion of using getformatteddate. Directly using Java is more efficient and flexible than the javascript presented in that task.
As far as how Tasker formats the date and time, I think that the device settings should be adhered to. On my device that would make the separator between hours and minutes a colon.