---
title: DateFeatures
framework: createmlcomponents
role: symbol
role_heading: Structure
path: createmlcomponents/datefeatures
---

# DateFeatures

A set of date and time features.

## Declaration

```swift
struct DateFeatures
```

## Overview

Overview The choice of features for a particular task depends on the relevance of different date and time components. For example a dataset of weather data may require hour and day-of-year features, while a dataset of workout metrics may require second, hour, and weekday features.

## Topics

### Features

- [day](createmlcomponents/datefeatures/day.md)
- [dayOfYear](createmlcomponents/datefeatures/dayofyear.md)
- [hour](createmlcomponents/datefeatures/hour.md)
- [minute](createmlcomponents/datefeatures/minute.md)
- [month](createmlcomponents/datefeatures/month.md)
- [second](createmlcomponents/datefeatures/second.md)
- [weekOfMonth](createmlcomponents/datefeatures/weekofmonth.md)
- [weekOfYear](createmlcomponents/datefeatures/weekofyear.md)
- [weekday](createmlcomponents/datefeatures/weekday.md)

### Creating a date feature type

- [init(rawValue:)](createmlcomponents/datefeatures/init(rawvalue:).md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [Hashable](swift/hashable.md)
- [OptionSet](swift/optionset.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SetAlgebra](swift/setalgebra.md)

## See Also

### Time-based components

- [Creating a time-series classifier](createmlcomponents/creating-a-time-series-classifier.md)
- [Creating a time-series forecaster](createmlcomponents/creating-a-time-series-forecaster.md)
- [DateFeatureExtractor](createmlcomponents/datefeatureextractor.md)
- [LinearTimeSeriesForecaster](createmlcomponents/lineartimeseriesforecaster.md)
- [LinearTimeSeriesForecasterConfiguration](createmlcomponents/lineartimeseriesforecasterconfiguration.md)
- [TimeSeriesForecasterBatches](createmlcomponents/timeseriesforecasterbatches.md)
- [TimeSeriesForecasterAnnotatedWindows](createmlcomponents/timeseriesforecasterannotatedwindows.md)
- [TemporalFeature](createmlcomponents/temporalfeature.md)
- [TemporalSequence](createmlcomponents/temporalsequence.md)
- [TemporalSegmentIdentifier](createmlcomponents/temporalsegmentidentifier.md)
- [SlidingWindows](createmlcomponents/slidingwindows.md)
- [SlidingWindowTransformer](createmlcomponents/slidingwindowtransformer.md)
- [Downsampler](createmlcomponents/downsampler.md)
- [VideoReader](createmlcomponents/videoreader.md)
- [TemporalFileSegment](createmlcomponents/temporalfilesegment.md)
