# How to use DateEncoder for the data which has been generated persecond

**URL:** <https://discourse.numenta.org/t/how-to-use-dateencoder-for-the-data-which-has-been-generated-persecond/4435>\
**Category:** NuPIC\
**Tags:** encoders\
**Created:** [August 29, 2018, 6:04pm UTC](https://discourse.numenta.org/t/how-to-use-dateencoder-for-the-data-which-has-been-generated-persecond/4435 "2018-08-29T18:04:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sawandas](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sawandas](https://discourse.numenta.org/u/sawandas)\
**Post date:** [August 29, 2018, 6:04pm UTC](https://discourse.numenta.org/t/how-to-use-dateencoder-for-the-data-which-has-been-generated-persecond/4435/1 "2018-08-29T18:04:43Z")

</div>

We have a data csv which has the timestamp field increased by 1 second. How to configure the DateEncoder for per second data?

Time Stamp format is 10/4/2014 0:04:01 (MM/DD/YYYY hh:mm:ss)

10/4/2014 0:04:01  
10/4/2014 0:04:02  
10/4/2014 0:04:03  
10/4/2014 0:04:04

Please reply.

Sawan

---

<div class="post-metadata">

**Author:** ![learner](https://avatars.discourse-cdn.com/v4/letter/l/b782af/32.png) [@learner](https://discourse.numenta.org/u/learner)\
**Post date:** [August 29, 2018, 6:24pm UTC](https://discourse.numenta.org/t/how-to-use-dateencoder-for-the-data-which-has-been-generated-persecond/4435/2 "2018-08-29T18:24:46Z")

</div>

I don’t think you can use the DateEncoder for that purpose; the unit of the **timeOfDay** parameter is hours, and the argument type is **int** , so it looks like the smallest resolution possible is one hour.

You could get around it by pre-processing and converting your timestamp to seconds first, then encoding that with a RandomDistributedScalarEncoder.

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [August 29, 2018, 6:27pm UTC](https://discourse.numenta.org/t/how-to-use-dateencoder-for-the-data-which-has-been-generated-persecond/4435/3 "2018-08-29T18:27:06Z")

</div>

Related:

> [@Why can't I encode time in very small increments with DateEncoder?](https://discourse.numenta.org/t/why-cant-i-encode-time-in-very-small-increments-with-dateencoder/1356):
>
> [This question came up on Github](https://github.com/numenta/nupic/issues/3320), but I thought I would answer here. The type of patterns that datetime encoding encodes are things like “time of day”, “day of week”, “is weekend”, “minute of hour”, etc. These are human concepts (for the most part), and we are projecting our human organization of time (hours, weeks, minutes) into SDRs. That is great for timing that works at a scale that humans can rationalize about. When you get into sub-second timing, this idea of encoding breaks down. There …
