It would be very useful, if interval was also stored in seconds, in addition to current 2 columns. My use case is:
I have converted two dates to integers in Rules to be able to calculate difference between them. Now I want to calculate, how many time intervals fit into that difference, so I also need interval as seconds. Conversion is complicated b the fact, that I would need to use conditionals to calculate different values based on interval period.
Comments
Comment #2
milos.kroulik commentedOK, this is not possible by design. Sorry for silly request.
Comment #3
Sylense commentedFor anyone that should stumble upon this and need a solution I managed to pull this off using a computed field. I needed a way to do sorting and other things and so I converted the interval multiplier and period back to seconds. I simply used the function already provided by Interval (interval_php_interval) to do it. Be sure to change the data type on the computed field from varchar to integer so you can properly sort, etc.
If you don't want to use a computed field or only want to display the seconds you could also create a custom field formatter and use the same interval_php_interval function in the markup:
'#markup' => check_plain(strtotime(interval_php_interval($item), 0)),