---
title: "How to fix SQL-Toolkit to display date/time in correct format"
description: "SQL-Toolkit in Geneos may display date/time without seconds if the SQL query lacks proper formatting codes. To fix this, amend the query to include date/time format specifiers like '%Y-%m-%d %H:%i:%S' for correct display."
url: "https://docs.itrsgroup.com/docs/faq/geneos/14066413765149-geneos-how-to-fix-sql-toolkit-to-display-date-time-in-correct-format/index.html"
---
## Related to

SQL-Toolkit. Time / date queries. Format.

### Problem

Direct SQL Query on a database returns date in the following format

![Geneos - How to fix SQL-Toolkit to display date/time in correct format](https://docscdn.itrsgroup.com/faq/images/geneos/14066413765149-14066070637469-mceclip2.png)

Result in Geneos dataview - this does not show the time in seconds format as per query above

![Geneos - How to fix SQL-Toolkit to display date/time in correct format](https://docscdn.itrsgroup.com/faq/images/geneos/14066413765149-14066043856413-mceclip1.png)

### Solution

The SQL query needs to be amended to include formatting codes.

Example - MYSQL query - should include FROM\_UNIXTIME(e.timestamp,'%Y-%m-%d %H:%i:%S') instead of FROM\_UNIXTIME(e.timestamp)

```
select e.ref,e.timestamp,FROM_UNIXTIME(e.timestamp),FROM_UNIXTIME(e.timestamp,'%Y-%m-%d %H:%i:%S')from event_table e,node_ref_table n where e.node_ref=n.ref order by timestamp desc limit 300, 500;
```

![Geneos - How to fix SQL-Toolkit to display date/time in correct format](https://docscdn.itrsgroup.com/faq/images/geneos/14066413765149-14066316154141-mceclip3.png)

![Geneos - How to fix SQL-Toolkit to display date/time in correct format](https://docscdn.itrsgroup.com/faq/images/geneos/14066413765149-14066370786973-mceclip4.png)

Note - this is an example MY-SQL query the syntax may differ across different database flavours.


