I've played around with the alarm database before and this will work
if you're rooted. If you're not rooted, I think you're out of luck
because I don't think Tasker itself can read the alarm database. You
don't have to be root to read the file but you have to be rooted to
have the tools to read the file. There may be a non-rooted option, I
just don't know. There is surely an API call to get it without having
to read the database, but who knows.
Anyway, run this command with the locale execute plugin:
sqlite3 -separator " : " /data/data/com.android.deskclock/databases/
alarms.db "SELECT * from alarms;" | grep ': 1 : 1 : :' | awk -F' '
'{ print $3 $4 $5 }' | sort -n | head -n1 > /sdcard/nextalarm
then read the nextalarm file with Tasker.
There is one downside. It doesn't work if the alarm is set to the
minutes between 1 and 9 because the data isn't stored with a 0 before
the minutes. So 7:00 becomes 7:0 and 7:05 becomes "7:5." I sort the
data numerically so 7:00 7:05 and 7:10 ends up looking and being
sorted like this:
7:0
7:10
7:5
and that makes 7:05 come after 7:10.
Also, the alarms are displayed in 24 hour time so you're out of luck
if you like 12 hour time. These could be fixed but I don't have the
time at the moment and would require a script instead of a command.