# How to extract hour from time field

**URL:** https://discuss.tryton.org/t/how-to-extract-hour-from-time-field/2051
**Category:** Developer
**Created:** [December 9, 2019, 6:30am UTC](https://discuss.tryton.org/t/how-to-extract-hour-from-time-field/2051 "2019-12-09T06:30:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![prashasti.sharma](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/p/58f4c7/32.png) [@prashasti.sharma](https://discuss.tryton.org/u/prashasti.sharma)
#### Post date: [December 9, 2019, 6:30am UTC](https://discuss.tryton.org/t/how-to-extract-hour-from-time-field/2051/1 "2019-12-09T06:30:41Z")

</div>

Eg: time\_of\_measurement = fields.Time(‘Time At Measurement’.  
Sir, how to extract hour from this given Time field and display as an output.

---

<div class="post-metadata">

### Author: ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)
#### Post date: [December 9, 2019, 8:29am UTC](https://discuss.tryton.org/t/how-to-extract-hour-from-time-field/2051/2 "2019-12-09T08:29:22Z")

</div>

You should make a `fields.Function` that returns the hour part of the time.
