Reputation: 139
The following line is from a query that I keep getting an error on. When I change the %s to 00 it works just fine. How do I keep the formatting to have the actual seconds:
from_unixtime(el.DeviceTimeStamp/1000, '%Y-%m-%d %H:%i:%s') as 'Entry_Timestamp'```
Upvotes: 0
Views: 87
Reputation: 139
On a complete lark I changed '%s' to be '%S' in my query and now it works fine.
Upvotes: 0
Reputation: 133400
I'm not in python but%s is used for passing param so Try escaping the % using %%
from_unixtime(el.DeviceTimeStamp/1000, '%%Y-%%m-%%d %%H:%%i:%%s') as 'Entry_Timestamp'```
or
from_unixtime(el.DeviceTimeStamp/1000, '%Y-%m-%d %H:%i:%%s') as 'Entry_Timestamp'```
Upvotes: 2