# Weekday or hour fields

**URL:** <https://www.ruby-forum.com/t/weekday-or-hour-fields/117211>\
**Category:** Rails\
**Created:** [October 14, 2007, 9:16pm UTC](https://www.ruby-forum.com/t/weekday-or-hour-fields/117211 "2007-10-14T21:16:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyavorski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dyavorski](https://www.ruby-forum.com/u/dyavorski)\
**Post date:** [October 14, 2007, 9:16pm UTC](https://www.ruby-forum.com/t/weekday-or-hour-fields/117211/1 "2007-10-14T21:16:22Z")

</div>

Hi all  
I am trying to build a table that one of its columns is a week day and  
another is an hour in the day.  
The create\_table syntax enables one only to determine a datetime or time  
column which contain too much data  
Any ideas as to how it can be done?  
At the moment I use “string” for both columns.  
Thanks  
Danny

---

<div class="post-metadata">

**Author:** ![dyavorski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dyavorski](https://www.ruby-forum.com/u/dyavorski)\
**Post date:** [October 14, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/weekday-or-hour-fields/117211/2 "2007-10-14T21:29:12Z")

</div>

you could use ints for both… ruby Time.wday will give you the day of  
week, with Sunday being 0

On Oct 14, 3:16 pm, Danny Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
