Im needing to convert the time to a more readable format?
can someone link me to a thread that helps explain this? or walk me through it?
Im needing to convert the time to a more readable format?
can someone link me to a thread that helps explain this? or walk me through it?
https://docs.inductiveautomation.com/display/DOC81/system.date.fromMillis
Though, I wonder if just setting the column type on the Perspective table to Date would be enough to get it to coerce for you… not sure.
@Kevin.Herron beat me to it, but
Are you displaying it in a table? Setting the column render type to Date will force it to respect whatever you supply as dateFormat.
the table in question is being referenced by another table in json format for a comparison of sorts. so when the time column is populated its in that string looking format and just setting the time column to the correct date format (like usually would work) doesn’t convert it.
may help, may not…
from datetime import datetime
ts = int('1658342356')
print(datetime.utcfromtimestamp(ts).strftime('%d-%m-%y %H:%M:%S'))
Out of curiosity, what does the data itself look like in the table? From a sample table I did up:
Note the t_stamp is in orange. If it’s green in your data, then it’s coming in from the query as a string.
Or use the system.date.* functions
ts = int('1658342356')
print system.date.fromMillis(ts)
here is what the data looks like: