# Get Date and Time From Video Filename (HELP)

**URL:** https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246
**Category:** Support
**Created:** [July 10, 2024, 8:15am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246 "2024-07-10T08:15:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![BabaDubu](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/41988e/32.png) [@BabaDubu](https://community.mp3tag.de/u/BabaDubu)
#### Post date: [July 10, 2024, 8:15am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246/1 "2024-07-10T08:15:05Z")

</div>

I have a large number of videos (MP4) recorded from my cellphone that are named in the format VID\_20230919\_135105.mp4  
The name contains the date (20230919) which is the 19th of September 2023 in this case and the time the video was recorded (135105) which is 1:51:05 pm in this case. I am new to both mp3tag and regex but i have the vague idea that i could extract this information from the filename and save them into YEAR and RELEASETIME tags via regex.  
Please save me from having to do this manually for almost 600 files!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [July 10, 2024, 8:38am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246/2 "2024-07-10T08:38:19Z")

</div>

> [@BabaDubu](#):
>
> VID\_20230919\_135105

Create an action of the type "Format value" or use Convert\>Tag-Tag for RELEASETIME  
Format string: `$regexp(%_filename%,VID_(\d\d\d\d)(\d\d)(\d\d)_(\d\d)(\d\d)(\d\d),$1-$2-$3T$4:$5:$6)`

To fill YEAR use the same function this time for YEAR with  
Format string: `$num(%releasetime%,4)`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 10, 2024, 8:53am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246/3 "2024-07-10T08:53:19Z")

</div>

From the official [ID3 documentation](https://id3.org/id3v2.4.0-structure) about the timestamp format,  
Section "4. ID3v2 frame overview":  
...

 ![image](https://community.mp3tag.de/uploads/default/original/3X/2/e/2e960b6d33f1d3f99bd4ceab94ef039a344017c3.png)  
...

To be searchable in this forum:

> The timestamp fields are based on a subset of [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). When being as precise as possible the format of a time string is  
> `yyyy-MM-ddTHH:mm:ss`  
> (year, "-", month, "-", day, "T", hour (out of 24), ":", minutes, ":", seconds), but the precision may be reduced by removing as many time indicators as wanted.  
> Hence valid timestamps are  
> `yyyy`  
> `yyyy-MM`  
> `yyyy-MM-dd`  
> `yyyy-MM-ddTHH`  
> `yyyy-MM-ddTHH:mm`  
> and  
> `yyyy-MM-ddTHH:mm:ss`  
> All time stamps are UTC. For durations, use the slash character as described in 8601, and for multiple non-contiguous dates, use multiple strings, if allowed by the frame definition.

---

<div class="post-metadata">

### Author: ![BabaDubu](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/41988e/32.png) [@BabaDubu](https://community.mp3tag.de/u/BabaDubu)
#### Post date: [July 10, 2024, 9:49am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246/4 "2024-07-10T09:49:11Z")

</div>

> [@ohrenkino](#):
>
> `$regexp(%_filename%,VID_(\d\d\d\d)(\d\d)(\d\d)_(\d\d)(\d\d)(\d\d),$1-$2-$3T$4:$5:$6)`

Thanks this is exactly what I needed

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [August 9, 2024, 9:49am UTC](https://community.mp3tag.de/t/get-date-and-time-from-video-filename-help/65246/5 "2024-08-09T09:49:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
