Data Substitutions

Suntimes supports limited %substitutions, a set of tags that are replaced with values from the data set.

Substitutions may be used within widget titles, alarm notes, or within action data or extras.

widget title widget title action data action data

Examples

%loc, %M, or %t can be used to include the location name, event name, or time zone as part of a widget’s title.

%dm and %em@<event> can be used to pass time (milliseconds) as part of an action; e.g. URI content://com.android.calendar/time/%dm opens the calendar app.

%lat and %lon can be used to pass the location as part of an action; e.g. URI geo:%lat,%lon opens the map app.

Subsections of Data Substitutions

Available Substitutions

Date/Time:

  • %t for time zone (id) (e.g. US/Arizona)
  • %d for formatted date (e.g. February 12)
  • %dd for day (short) (e.g. Mon)
  • %dD for day (long) (e.g. Monday)
  • %dY for year (e.g. 2018)
  • %dt for formatted time (of last update)
  • %dT for formatted time with seconds (of last update)
  • %dm for time in milliseconds (of last update)
  • %eot for formatted ’equation of time’ (of last update)
  • %eot_m for ’equation of time’ milliseconds (of last update)

Location:

  • %loc for label (e.g. Phoenix)
  • %lat for latitude
  • %lon for longitude
  • %lel for elevation (e.g. 385 meters)

Misc:

  • %s for data source (e.g. sunrisesunsetlib)
  • %id for appWidgetID

Sun Widgets:

  • %m for mode (short) (e.g. Civil)
  • %M for mode (long) (e.g. Civil Twilight)
  • %o for order (e.g. Last/Next, Today)
  • %em@<event> event milliseconds
  • %et@<event> event formatted time
  • %eT@<event> event formatted time (with seconds)
  • %eA@<event> event altitude
  • %eZ@<event> event azimuth
  • %eD@<event> event declination
  • %eR@<event> event right ascension

where <event> is:

Sun WidgetsSun Position Widgets
<event>
rising sr
setting ss
noon sn
rising setting
civil twilight cr cs
nautical twilight nr ns
astronomical twilight ar as
blue hour 4deg b4r b4s
blue hour 8deg b8r b8s
golden hour gr gs

Moon Widgets:

  • %i for moon illumination (e.g. 25%)
  • %M for moon phase (e.g. Waxing Crescent)
  • %o for order (e.g. Last/Next, Today)

Solstice Widgets:

  • %m for mode (short) (e.g. Solstice)
  • %M for mode (long) (e.g. Winter Solstice)
  • %o for order (e.g. Closest Event, Upcoming Event)