Run Shell with the command "date +%Z" gives EDT for me when DST is in effect, EST when not.
TimeZone.inDayLightSavingsTime(new Date()).
Also, I know I can hard-code the DST algorithm myself within a Tasker task, given the current USA DST conventions. However, I've been looking for a way to simply query some sort of system or Tasker attribute within a Tasker task that tells me whether we are currently running under DST.
I guess this just isn't possible.
.
Matt
What's the problem with doing a run shell action?Matt
#!/system/xbin/sh
date=/system/xbin/date
fmt='%Y/%m/%d %H:%M:%S'
ts=$(${date} "+${fmt}")
curr=$(${date} -u -D "${fmt}" -d "${ts}" '+%s')
utc=$(${date} -D "${fmt}" -d "${ts}" '+%s')
echo $(( ( utc - curr ) * 1000 ))
exit 0
Matt
Doing variable convert doesn't already do it in the right time zone?Matt
I need to determine if daylight savings applies to the target date of an event in the calendar as opposed to the current date, and vice-versa. Ideally, factoring in the specified 'location' of the calendar event as well. Actually if location wasn't factored it would be fairly useless :/
So, I am looking for a variation of date + %z but for a future date, not the current one. I can work out a method of comparison against location later but, really if this syntax could be modified for what I need that make the process way easier.
Thanks for the suggestion, just wanted to confirm that's a shell command that requires root?
You can use the BusyBox binary without root, but it can't create the symlinks, so you need to call it through BusyBox.
Scott
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, 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.
You can use the BusyBox binary without root, but it can't create the symlinks, so you need to call it through BusyBox.
I will need to play around with it. And install: https://play.google.com/store/apps/details?id=stericson.busybox
The problem I am having, is creating calendar events using tasker that complies with 'starting in x minutes' field for entry. I can calculate the total number of minutes between two given periods, except it's off by an hour either way when daylight savings applies or no-longer applies.
I'm hoping this method will be the most efficient.
Thanks again!