Timestamp into variable - remove leading zero

Posted on
Sat Aug 27, 2016 1:19 am
srkinard offline
Posts: 320
Joined: Apr 10, 2016
Location: Austin, Texas

Timestamp into variable - remove leading zero

I currently have a scheduled task where every minute it insets the current timestamp into a variable called HVAC_Time
Format string is %I:%M %p

This works, but it sticks me with the leading zero for any times other than 10/11/12.

What would be the best way to strip away that leading zero? I know from reading the notes that's like the standard Python result.

Image

gives:

Image

References to the variable are:

Code: Select all
ID:          517881967
Python:      indigo.variables[517881967] # "HVAC_time"
Applescript: variable named "HVAC_time"


Suggestions? I had tried this but for some reason it would stop updating after a few minutes:

Code: Select all
set thetime to the value of variable named "HVAC_time"
if (thetime begins with "0") then set thetime to text 2 thru -1 of thetime
set the value of variable named "HVAC_time" to thetime

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest