now works for saving/updating time values, and grouping by months