Question: I am trying to count events that happen in a day, which in itself is easy:

```
SELECT date(time),COUNT(DISTINCT comment)
FROM data
GROUP BY date(time)

```

But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change time zone of entire program and etc. Maybe I can somehow apply timezone to this query or pad time?

Answer: 
Convert the integer to string first, and then use `map` to apply `int` on it:

```
>>> num = 132
>>> map(int, str(num))    #note, This will return a map object in python 3.
[1, 3, 2]

```

or using a list comprehension:

```
>>> [int(x) for x in str(num)]
[1, 3, 2]

```
```python
num = 123
print(num)
num = list(str(num))
num = [int(i) for i in num]
print(num)

```