Page 1 of 1
extract the month, day, hour, minute from current time
Posted: 15 Jan 2014 00:56
by srjohn
I have a variable now=getDate()
For example time now is "2014-01-15 21:35:46"
How do I extract the month, day, hour, minute to seperate variables?
For example month=01, day=15, hour=21, minute=35.
Can any one help?
Thanks!
-srjohn
Re: extract the month, day, hour, minute from current time
Posted: 15 Jan 2014 13:37
by srjohn
I can use {triggertime,dateformat,HH:mm:ss} as the displayed text in notification.
For example it shows "21:30:30"
I want to save "21:30:30" as a variable.
So I create a script.
Code: Select all
myTime={triggertime,dateformat,HH:mm:ss}
But Automagic reported error while executing the script.
Is there anything wrong?
Thanks,
-srjohn
Re: extract the month, day, hour, minute from current time
Posted: 15 Jan 2014 14:05
by MURTUMA
Look at the script action in this flow. It's not exactly what you want but it should help you forward.
http://automagic4android.com/flow.php?i ... 64b688391a
Re: extract the month, day, hour, minute from current time
Posted: 15 Jan 2014 16:23
by srjohn
Re: extract the month, day, hour, minute from current time
Posted: 15 Jan 2014 20:28
by Martin!
srjohn wrote:I can use {triggertime,dateformat,HH:mm:ss} as the displayed text in notification.
For example it shows "21:30:30"
I want to save "21:30:30" as a variable.
So I create a script.
Code: Select all
myTime={triggertime,dateformat,HH:mm:ss}
But Automagic reported error while executing the script.
Is there anything wrong?
Thanks,
-srjohn
I think the problem with your code is that you forgot the quotation marks:
Code: Select all
myTime="{triggertime,dateformat,HH:mm:ss}"
Re: extract the month, day, hour, minute from current time
Posted: 18 Jan 2014 05:11
by srjohn
Martin, thanks!
It is working now!
-srjohn