Questions tagged [date-range]

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date range is commonly used:

  • as search criterion for any date related data,
  • when operating on data referring to periods of time.
1608 questions
4
votes
1 answer

Pandas: monthly date range with number of days

Suppose I have a start and end dates like so: start_d = datetime.date(2017, 7, 20) end_d = datetime.date(2017, 9, 10) I wish to obtain a Pandas DataFrame that looks like this: Month NumDays 2017-07 12 2017-08 31 2017-09 10 It shows the…
gberger
  • 2,813
  • 3
  • 28
  • 50
4
votes
3 answers

How to delete a date from pandas date_range

So I have a pandas date_range like so dates = pd.date_range(start='2005-1-1', end='2014-12-31', freq='D') I want to remove all the extra days resulting from leap years. I do a for loop for each in index: if each.month==2 and each.day==29: …
chidimo
  • 2,684
  • 3
  • 32
  • 47
4
votes
1 answer

C# How to create Date and Time Range?

I have a program which processes a log text file, retrieves the date time, converts the date time to the system's DateTime format. However the program does not seem to recognized the various date time range that is selected. The program should…
JavaNoob
  • 3,494
  • 19
  • 49
  • 61
4
votes
1 answer

Bokeh patches plot with dates as x-axis shifts the ticks one to the right

I'm trying to adapt the brewer example (http://docs.bokeh.org/en/latest/docs/gallery/stacked_area.html) to my needs. One of the things I'd like is to have dates at the x-axis. I did the following: timesteps = [str(x.date()) for x in…
Kora K
  • 425
  • 1
  • 4
  • 15
4
votes
2 answers

Create a date table in hive

How to create a table in hive which should have all the dates from 1st Jan 2016 till today (01-01-2016 to 12-10-2016)? The table would have only one column i.e. the date column. Thanks.
ravi.j
  • 41
  • 1
  • 2
4
votes
4 answers

What is the performace of PHPs strtotime()?

I am doing some large timestamp-list iterations: Putting them in tables with date-ranges, and grouping them by ranges. In order to do that, I found strtotime() a very helpfull function, but I am worried about its performance. For example, a…
berkes
  • 26,996
  • 27
  • 115
  • 206
4
votes
2 answers

Extract gaps from a List of Range

I have a list of Range based on the Guava library, they never overlap. 2001-01-10 → 2001-01-15 2001-01-20 → 2001-01-22 2001-01-28 → 2001-01-29 Then, I have a reference range: 2001-01-01 →…
Guillaume F.
  • 5,905
  • 2
  • 31
  • 59
4
votes
2 answers

MongoDB - Check if Date Range A overlaps other Date Ranges b

I've got a collection booking. Inside that Collection i've got for debug one document: { "_id": ObjectID("55d7608120b345d2cc7c9f45"), "name": "booking1", "start": ISODate("2015-01-10T00:00:00.000Z"), "end": ISODate("2015-01-20T00:00:00.000Z")} Now…
DroidSheep
  • 75
  • 8
4
votes
1 answer

Date ranges to series of 1 or 0 in R

I have pharmacy claims data that list start and end fill dates by patient. For calculations down the road I would like to record a true (1) or false(0) diary of whether or not each patient has dates recorded for a given day. Using the sample data…
Blake
  • 207
  • 1
  • 3
  • 9
4
votes
2 answers

How to pandas.date_range() to generate a range with no timestamps posterior to end parameter?

I'm working in python with pandas. I'm querying an external data source for unique users over a group of days (eg unique users per 30 days or per 2 days or per 7 days). The query needs a period start, a period end and an interval ( number of…
Tristan Boudreault
  • 133
  • 1
  • 2
  • 11
4
votes
1 answer

User-defined date range for Access query pulling outside date range

I have an Access 2007 database that requires a query be run every week to gather every record that was worked on the prior week. The current setup is: I have a query where the date range's WHERE criteria is: Between…
Caleb W.
  • 51
  • 6
4
votes
1 answer

Consolidate adjacent, overlapping and embedded ranges into mutually exclusive ranges

The environment is SQL Server 2014. I am dealing with reducing many insurance enrollment details (small ranges of first and last) into much larger mutually exclusive (ME) ranges of continuous enrollment. For clarity the problem is reduced to sample…
Richard
  • 25,390
  • 3
  • 25
  • 38
4
votes
2 answers

Who had the car during July

So I have a table which has start, end, taxi, and driver. City now wants to get historical look ups by month of who had which cab during month, and when any changes occurred. So this grabs assignment rows which started in July 2014, ended in July…
jerrygarciuh
  • 21,158
  • 26
  • 82
  • 139
4
votes
1 answer

Check if timestamp is within tsrange

Is it possible to construct an on-the-fly tsrange and check if a value is within that? I have a table that has two fields, session_start and session_end and I want to run a query that checks if a passed value is between those two values. Something…
Christian P.
  • 4,784
  • 7
  • 53
  • 70
4
votes
3 answers

Average stock history table

I have a table that tracks changes in stocks through time for some stores and products. The value is the absolute stock, but we only insert a new row when a change in stock occurs. This design was to keep the table small, because it is expected to…
froque
  • 442
  • 2
  • 13