0

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'```
1
  • 1
    How are you executing this? %s is a placeholder value for the Python driver. Commented May 13, 2019 at 16:44

2 Answers 2

2

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'```
Sign up to request clarification or add additional context in comments.

Comments

0

On a complete lark I changed '%s' to be '%S' in my query and now it works fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.