# Extract Date from Data

**URL:** https://forum.atmospherictoolbox.org/t/extract-date-from-data/644
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [May 3, 2023, 10:09am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644 "2023-05-03T10:09:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [May 3, 2023, 10:09am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/1 "2023-05-03T10:09:18Z")

</div>

Hello

I want to extract date of that particular nc file from the CH4 data. Is it possible? I am following the usecase 3 while converting the nc data to geodataframe. But I need date in the final geodataframe.

```auto
operations_trop = ";".join([
    "CH4_column_volume_mixing_ratio_dry_air_validity>95",
    "latitude>31.254333999914312",
    "latitude<31.74162156648225",
    "longitude>74.00684949990466",
    "longitude<74.64111329724102",
    "keep(latitude_bounds,longitude_bounds,CH4_column_volume_mixing_ratio_dry_air)",
    "derive(CH4_column_volume_mixing_ratio_dry_air [ppbv])",
    "derive(area {time} [km2])",
])

```

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [May 3, 2023, 10:27am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/2 "2023-05-03T10:27:14Z")

</div>

This easiest is to just add `datetime_start` to the `keep` operation: `keep(datetime_start,latitude_bounds,longitude_bounds,CH4_column_volume_mixing_ratio_dry_air)`

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [May 3, 2023, 10:53am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/3 "2023-05-03T10:53:14Z")

</div>

@sander.niemeijer It is giving date in this format which is not readable I need it in the string format like 2020-11-01

 ![date](https://forum.atmospherictoolbox.org/uploads/default/original/1X/5f8c52a5b9ad160cd472c678af268b865552305f.png)

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [May 3, 2023, 11:03am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/4 "2023-05-03T11:03:00Z")

</div>

![image](https://forum.atmospherictoolbox.org/uploads/default/original/1X/fa23a3b2d29f21d24460810d1ff742b69f745424.png)

---

<div class="post-metadata">

### Author: ![jawi289o](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jawi289o](https://forum.atmospherictoolbox.org/u/jawi289o)
#### Post date: [May 3, 2023, 11:23am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/5 "2023-05-03T11:23:48Z")

</div>

I have solved it Thank you!

---

<div class="post-metadata">

### Author: ![TheRed86](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@TheRed86](https://forum.atmospherictoolbox.org/u/TheRed86)
#### Post date: [June 12, 2023, 11:05am UTC](https://forum.atmospherictoolbox.org/t/extract-date-from-data/644/6 "2023-06-12T11:05:13Z")

</div>

Can you tell me how did you solve it?
