# Date-Time

## Overview

### ISO 8601 Date Format

#### Sources

* [Progress.com / Understanding ISO 8601 Date and Time Format](https://www.progress.com/blogs/understanding-iso-8601-date-and-time-format)

## Examples

### Show only future dates

```swift
DatePicker("Please enter a date", selection: $wakeUp, in: Date.now...)
```

![](https://5317963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F598GXhEFvy2PX7VpZjCw%2Fuploads%2FdZfXjw0ejI1co2KKYYQd%2Fimage.png?alt=media\&token=3a552072-37d2-4834-9124-437d46ca338a)

...

```swift
Text(Date.now.formatted(date: .long, time: .shortened))
```

![](https://5317963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F598GXhEFvy2PX7VpZjCw%2Fuploads%2Ft0vKGluUZzWV6IlZTtan%2Fimage.png?alt=media\&token=22d8d582-17d0-49d8-b979-3f51571227b9)

...

```swift
Text(Date.now.formatted(date: .long, time: .omitted))
```

![](https://5317963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F598GXhEFvy2PX7VpZjCw%2Fuploads%2FoF0P0sx4wfISAj4REWyZ%2Fimage.png?alt=media\&token=9942b2a5-c645-4029-a116-b81b3a73ab28)

...

```swift
Label(date.formatted(date: .complete, time: .omitted), systemImage: "calendar")
```

![](https://5317963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F598GXhEFvy2PX7VpZjCw%2Fuploads%2FUvBdGpE33ytpM7lGnwTv%2FIMG_D5C1F7F01884-1.jpeg?alt=media\&token=df8d2a44-3688-436a-827f-ed2853dc17da)

## Date Decoding

{% embed url="<https://youtu.be/kD8nolPczTc>" %}

## Codes

### addingTimeInterval()

### DateComponents()

### DatePicker()

labelIsHidden() removed label

### displayedComponents

### timezone

## Sources

### Videos

{% embed url="<https://youtu.be/V1oL2dCwPQo>" %}

{% embed url="<https://youtu.be/YOFqCk6HS28>" %}

### Articles / Documents

* <https://medium.com/devtechie/date-formatting-in-swiftuis-text-view-a6599c3b01f2>
