# Enhancing Time Slice with User Property

**URL:** <https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37>\
**Category:** Extension Ideas\
**Created:** [March 4, 2020, 2:27pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37 "2020-03-04T14:27:25Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![daniel.henry](https://yyz1.discourse-cdn.com/flex031/user_avatar/discuss.epiforge.com/daniel.henry/32/28_2.png) [@daniel.henry](https://discuss.epiforge.com/u/daniel.henry)\
**Post date:** [March 12, 2020, 8:58pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/21 "2020-03-12T20:58:30Z")

</div>

Ahh, it’s in 100-nanosecond intervals since the invariant culture’s origin. Microsoft calls them ticks.

Uhh, does this help?

> <https://stackoverflow.com/questions/14427493/convert-ticks-to-unix-timestamp>

---

<div class="post-metadata">

**Author:** ![daniel.henry](https://yyz1.discourse-cdn.com/flex031/user_avatar/discuss.epiforge.com/daniel.henry/32/28_2.png) [@daniel.henry](https://discuss.epiforge.com/u/daniel.henry)\
**Post date:** [March 12, 2020, 9:08pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/22 "2020-03-12T21:08:52Z")

</div>

Also, you could change the extension. The [SQLiteAsyncConnection](https://github.com/praeclarum/sqlite-net/blob/master/src/SQLiteAsync.cs) class constructor has an optional parameter to store dates and times as ticks and its defaulted on. You could pass false to it in Extension.cs and see if you prefer that result. Just disconnect from SQLite before making the change!

---

<div class="post-metadata">

**Author:** ![daniel.henry](https://yyz1.discourse-cdn.com/flex031/user_avatar/discuss.epiforge.com/daniel.henry/32/28_2.png) [@daniel.henry](https://discuss.epiforge.com/u/daniel.henry)\
**Post date:** [March 12, 2020, 9:11pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/23 "2020-03-12T21:11:20Z")

</div>

Ahh, we are using DateTimeOffsets in the extension as well, so it would be more work than just changing the constructor call. You might want to just take the ticks conversion route. I guess the cool thing is that you can change it however you want. 😉

---

<div class="post-metadata">

**Author:** ![daniel.henry](https://yyz1.discourse-cdn.com/flex031/user_avatar/discuss.epiforge.com/daniel.henry/32/28_2.png) [@daniel.henry](https://discuss.epiforge.com/u/daniel.henry)\
**Post date:** [March 12, 2020, 9:28pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/24 "2020-03-12T21:28:30Z")

</div>

What coding environment are you working with in accessing this SQLite database?

---

<div class="post-metadata">

**Author:** ![donvnielsen](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@donvnielsen](https://discuss.epiforge.com/u/donvnielsen)\
**Post date:** [March 12, 2020, 10:01pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/25 "2020-03-12T22:01:55Z")

</div>

I’m good for now. Have a good night.

```auto
with Items as (
    select wi.Id WorkItem
         , wi.name Description
         , wi.notes Notes
         , lv.name Task
         , TP.name Property
         , TPV.Text Value
    from WorkItems WI
             left join ListValuePropertyValues tasks on tasks.WorkItemId = WI.Id
             left join ListValues lv on lv.Id = tasks.ListValueId
             left join ListValueProperties LVP on lvp.Id = lv.ListValuePropertyId
             left join TextPropertyValues TPV on TPV.WorkItemId = WI.Id
             left join TextProperties TP on TP.Id = TPV.TextPropertyId
)
select W.*,ts.id
    ,datetime(ts.start/10000000-62136892800, 'unixepoch' ) begin
    ,datetime(ts.End/10000000-62136892800, 'unixepoch' ) end
    ,(ts.start - ts.End)/10000000 - 62136892800
from Items W
join TimeSlices TS on WorkItemId = W.WorkItem

```

---

<div class="post-metadata">

**Author:** ![daniel.henry](https://yyz1.discourse-cdn.com/flex031/user_avatar/discuss.epiforge.com/daniel.henry/32/28_2.png) [@daniel.henry](https://discuss.epiforge.com/u/daniel.henry)\
**Post date:** [March 12, 2020, 10:11pm UTC](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37/26 "2020-03-12T22:11:06Z")

</div>

Awesome! Good night to you, as well.

[Previous page](https://discuss.epiforge.com/t/enhancing-time-slice-with-user-property/37.md?page=1)
