Last active
December 14, 2015 16:58
-
-
Save swartzrock/5118602 to your computer and use it in GitHub Desktop.
Creating a list of DateTime's between two given dates based on an interval using List.tabulate()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val PRE_DST_DATE = "03/09/2013 19:00".toDateTime | |
val POST_DST_DATE = "03/10/2013 00:00".toDateTime | |
val interval = 15 | |
val minutePeriods = Minutes.minutesBetween( PRE_DST_DATE, POST_DST_DATE ).getMinutes / interval | |
val datePeriods = List.tabulate[DateTime](minutePeriods)( minutes => PRE_DST_DATE.plusMinutes(minutes * interval) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment