The first real trouble you will have is knowing the correct GMT offset for those dates (basically is daylight savings in effect or not)
And that will vary depending on date and location since different places have gone on / off daylight time at different times over the years
After that its simple math to subtract the GMT offset so you’re dealing in those times at GMT
What I’m missing is the range given 1/2/2015 to 11/28/2015 doesn’t match the start & end of the result
The result starts earlier and ends later ?
Good question. Maybe I’m overthinking what it is I’m trying to accomplish. I just need to calculate the beginning of the month x months back. So I’m thinking to set my range for year-to-date, I would just need to calculate the GMT seconds of 1/1/yyyy. From there, I can use the DateInterval function to calculate the summary intervals. Something like this?
Using Xojo.Core
Dim today As New Xojo.Core.Date = Xojo.Core.Date.Now
Dim d As New Xojo.Core.Date(today.Year, 1, 1, TimeZone.Current)
Dim secondsStart As Int64 = d. SecondsFrom1970
From this use the DateInterval or DateAdd to calculate the end and start of each range?
Thanks for the help. Here is what I came up with in case others need the same.
[code] Dim gmt As New Xojo.Core.TimeZone(0)
Dim dateStart As Xojo.Core.Date
Dim dateEnd As xojo.Core.Date
Dim dInterval As New DateInterval
Dim secondsStart, secondsEnd As Int64