today's date as expression

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

today's date as expression

Post by Rafi4 » 12 Dec 2018 04:25

hi Martin and all
how can I get today's date or time as expression.

for example:
today is Dec 12

if date is Dec 12 write a file (true)
if date is not equal to Dec 12 notify on Statusbar (false)

give me script for time also(expression)

thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: today's date as expression

Post by Desmanto » 12 Dec 2018 17:45

Use the dateformat.

Code: Select all

s = "{getDate(),dateformat,MMM dd}"
MMM is for the month, and dd is for the date. For the Date format pattern, look at Automagic documention : Date format pattern

Later use expressionto check it.

Code: Select all

s == "Dec 12"
True to write file, and false to notif on statbar.
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.

Post Reply