How to set an alarm like 15 minutes from current time in my alarm app?
I tried doing it. I put current time in a variable using getDate().
So that I can add 15 minutes to it using addMinutes(d, a)
But getDate() gives a value like 1549293097522. I have no clue how to interpret it.
I have no programming background. And my understanding of Variables and functions are very limited. So can someone please help me with this.
Help with getDate() and setting alarm
Moderator: Martin
Help with getDate() and setting alarm
Asus Zenfone Max pro M1, Stock android, Oreo 8.1, Rooted
Re: Help with getDate() and setting alarm
Time is expressed as miliseconds from epoch (1st January 1970). To show as proper date time, you must use dateformat. For example
You can always add condition debug dialog after the script to check every available variables value at that point.
I am not sure if you want to clutter your alarm app with a lot of new alarm. Usually you can add alarm, but can't delete it. Better use Automagic default built-in trigger, Global Variable Date/Time as the alarm replacement. My Stay Awake Timer flow shows how to use it : viewtopic.php?f=3&t=7859
Code: Select all
properdt = "{getDate(),dateformat,dd MMMM yyyy HH:mm:ss}"
I am not sure if you want to clutter your alarm app with a lot of new alarm. Usually you can add alarm, but can't delete it. Better use Automagic default built-in trigger, Global Variable Date/Time as the alarm replacement. My Stay Awake Timer flow shows how to use it : viewtopic.php?f=3&t=7859
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Help with getDate() and setting alarm
Thanks for the reply @Desmanto,
I never thought of the deletion part. It would have been a real mess. I'll try out the Global Variable Date/Time trigger.
The flow you shared look super useful. I used to use a simple flow for setting screen on time. But I most likely forget to turn it off. Your flow is the solution. Thank you very much.
I never thought of the deletion part. It would have been a real mess. I'll try out the Global Variable Date/Time trigger.
The flow you shared look super useful. I used to use a simple flow for setting screen on time. But I most likely forget to turn it off. Your flow is the solution. Thank you very much.
Asus Zenfone Max pro M1, Stock android, Oreo 8.1, Rooted