The start date time of this range. This field is optional and if it is not set then there is no
lower bound on the date time range. If this field is not set then endDateTime must be
specified.
The end date time of this range. This field is optional and if it is not set then there is no
upper bound on the date time range. If this field is not set then startDateTime must be
specified.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-06 UTC."],[[["\u003cp\u003eDateTimeRange in Ad Manager API represents a flexible range of dates and times, having either a start, an end, or both.\u003c/p\u003e\n"],["\u003cp\u003eIt is used by multiple services like AdRuleService, ForecastService, and LineItemService, among others, for scheduling and targeting purposes.\u003c/p\u003e\n"],["\u003cp\u003eYou can define the range using startDateTime and/or endDateTime fields, allowing for open-ended or specific timeframes.\u003c/p\u003e\n"],["\u003cp\u003eDateTimeRange is crucial for controlling when ads are served or proposals are active within the Ad Manager platform.\u003c/p\u003e\n"]]],["The core content describes the `DateTimeRange` object, which represents a date and time range with optional upper and lower bounds. It's used across various services, including `AdRuleService`, `ForecastService`, and `YieldGroupService`. The `DateTimeRange` object has two key fields: `startDateTime`, defining the range's lower limit, and `endDateTime`, defining the upper limit. Either `startDateTime` or `endDateTime` must be provided. This is used in the ad manager API.\n"],null,["# type DateTimeRange (v202408)\n\n**Service** \n**AdRuleService** [AdjustmentService](/ad-manager/api/reference/v202408/AdjustmentService.DateTimeRange) [ForecastService](/ad-manager/api/reference/v202408/ForecastService.DateTimeRange) [LineItemService](/ad-manager/api/reference/v202408/LineItemService.DateTimeRange) [NativeStyleService](/ad-manager/api/reference/v202408/NativeStyleService.DateTimeRange) [ProposalLineItemService](/ad-manager/api/reference/v202408/ProposalLineItemService.DateTimeRange) [ProposalService](/ad-manager/api/reference/v202408/ProposalService.DateTimeRange) [PublisherQueryLanguageService](/ad-manager/api/reference/v202408/PublisherQueryLanguageService.DateTimeRange) [TargetingPresetService](/ad-manager/api/reference/v202408/TargetingPresetService.DateTimeRange) [YieldGroupService](/ad-manager/api/reference/v202408/YieldGroupService.DateTimeRange) **Dependencies** \n[DateTimeRangeTargeting](/ad-manager/api/reference/v202408/AdRuleService.DateTimeRangeTargeting) \n▼\n**DateTimeRange**\n\nRepresents a range of dates (combined with time of day) that has an upper and/or lower bound.\n\n*** ** * ** ***\n\nNamespace\n:\n `https://www.google.com/apis/ads/publisher/v202408`\n\n| Field ----- ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ### `startDateTime` | ` `[DateTime](/ad-manager/api/reference/v202408/AdRuleService.DateTime)` ` The start date time of this range. This field is optional and if it is not set then there is no lower bound on the date time range. If this field is not set then `endDateTime` must be specified. |\n| ### `endDateTime` | ` `[DateTime](/ad-manager/api/reference/v202408/AdRuleService.DateTime)` ` The end date time of this range. This field is optional and if it is not set then there is no upper bound on the date time range. If this field is not set then `startDateTime` must be specified. |"]]