# "How to Combine Date and Time Columns into a Single Column?"

**URL:** <https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435>\
**Category:** Ask for Help\
**Created:** [December 7, 2024, 11:29am UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435 "2024-12-07T11:29:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lawrence\_Chiu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lawrence_chiu/32/82869_2.png) [@Lawrence\_Chiu](https://community.glideapps.com/u/Lawrence_Chiu)\
**Post date:** [December 7, 2024, 11:29am UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/1 "2024-12-07T11:29:15Z")

</div>

I need some help combining two columns of data into one.  
Column A: a Cell contains 3 time values like 9:00, 10:00, 11:00.  
Column B: Contains date values like 02/03/24.  
I want to combine them so the result looks like this: 02/03/24 9:00, 02/03/24 10:00, 02/03/24 11:00.  
What’s the best way to achieve this? Any guidance would be greatly appreciated!  
Thanks in advance!🙏

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 7, 2024, 11:41am UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/2 "2024-12-07T11:41:12Z")

</div>

> **[Template Column | Glide Docs](https://www.glideapps.com/docs/automation/computed-columns/template-column)**
>
> Display dynamic text that can change with the values in other columns.

If it’s purely for displaying purposes, you can do it like this.

---

<div class="post-metadata">

**Author:** ![Lawrence\_Chiu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lawrence_chiu/32/82869_2.png) [@Lawrence\_Chiu](https://community.glideapps.com/u/Lawrence_Chiu)\
**Post date:** [December 7, 2024, 12:28pm UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/3 "2024-12-07T12:28:10Z")

</div>

Thanks for the reply, Sorry i didnt write it properly, i actually have all the value within the same cell for time. with template that would only give me  
02/03/24 9:00, 10:00, 11:00 within a cell instead of 02/03/24 9:00, 02/03/24 10:00, 02/03/24 11:00.

any other ways that i can create that result?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 7, 2024, 12:52pm UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/4 "2024-12-07T12:52:24Z")

</div>

Use a JavaScript column:

 ![CleanShot 2024-12-07 at 20.50.18@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/6/06f4bb5b89f692d2450d28cd4b4f03a2d408dcc7.jpeg)

```auto
const times = p2.split(', ');
const arr = [];
while (times.length>0) {
  const time = times.shift();
  arr.push(`${p1} ${time}`);
}
return arr.join(', ');

```

NB: Obviously, you should pass your actual column values as `p1` & `p2`, rather than hardcoding them. Also, I spent about 2 minutes on that JavaScript, I’m sure it could be improved 😉

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [December 7, 2024, 2:18pm UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/5 "2024-12-07T14:18:49Z")

</div>

Here another JS code to confirm that many times we can find the same solution using several ways in Glide:

```auto
let time=p2.split(", ");
let newList =""; 

for (let i = 0; i < time.length; i++) {
   newList += `${p1} ${time[i]},`
}
return newList.slice(0, -1)  

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/1/515788fea0c4ed8e4de47748b67dbfcbca766c42.png)

but I have to recognize that using the _join()_ method with an array  
`return arr.join(', ');`

is a more elegant solution than my `.slice(0, -1)` trick to delete the last comma (,) in the result 😉

Thanks for the reminder @Darren_Murphy

---

<div class="post-metadata">

**Author:** ![Lawrence\_Chiu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lawrence_chiu/32/82869_2.png) [@Lawrence\_Chiu](https://community.glideapps.com/u/Lawrence_Chiu)\
**Post date:** [December 7, 2024, 2:29pm UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/6 "2024-12-07T14:29:56Z")

</div>

thank you very much for the help!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 8, 2024, 3:37am UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/7 "2024-12-08T03:37:11Z")

</div>

![CleanShot 2024-12-08 at 10.36.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/8/08f9996d34d79ea0787726ed0735e726a84d9c51.png)

 ![CleanShot 2024-12-08 at 10.36.50](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/2/92eafa7309b8327e3c89214657c3156c67ff171b.png)

Here’s an alternative.

```auto
return p2.split(", ").map(time => `${p1} ${time}`).join(", ");

```

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 8, 2024, 4:08am UTC](https://community.glideapps.com/t/how-to-combine-date-and-time-columns-into-a-single-column/78435/8 "2024-12-08T04:08:19Z")

</div>

hehe I knew it would be possible as a one liner using map, but I was too lazy to figure it out 😂
