# How can I make Glide read a date as a string?

**URL:** <https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523>\
**Category:** Ask for Help\
**Tags:** date-math\
**Created:** [November 4, 2023, 1:42am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523 "2023-11-04T01:42:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 4, 2023, 1:42am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/1 "2023-11-04T01:42:31Z")

</div>

I’m working on a little app which reads data from an API end-point. I have to do a little messing around to make appropriate time zone adjustments. I originally wanted to keep the adjusted dates in date format so I can filter and sort on them but I haven’t been able to find a mechanism for doing this that works on all platforms (particularly IOS). So - I have settled on just saving them in text form for display. I still can’t get them to display properly on IOS, even when I put them into a larger string with other text. Glide is being very clever and interpreting the date as a date (tried long and short form variations - all the same).

How can I make Glide ignore the date in a string and just render the thing as I formatted it?

I guess another possibility is that this is happening at the client side but I’m sceptical.

---

<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:** [November 4, 2023, 6:14am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/2 "2023-11-04T06:14:07Z")

</div>

Here is how I usually handle date formatting:

- Start by using a math column to convert the raw date into an integer in YYYYMMDD format. Use the following formula:

```auto
Year(Date) * 10^4
+ Month(Date) * 10^2
+ Day(Date)

```

- The above ensures that you have a representation of a date that is completely non-ambiguous.
- Next use that integer value to convert back to a date with a Text to Date column. You need to specify the format as `yyyyMMdd` and apply an appropriate utc offset:

 ![CleanShot 2023-11-04 at 14.10.23@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/6/465ec793db3aa5ed72f4ffa34dfc0a71e70c90d4.jpeg)

- Finally, use a Format Date column to convert the generated date to a string, applying whatever format you need.

The above should work reliably on all devices, and regardless of device/browser regional/language settings.

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 7, 2023, 3:47am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/3 "2023-11-07T03:47:16Z")

</div>

Thanks for this - I also thought this was the surefire fix, but for some reason it is not working. This is what I have in the dev environment:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/6/a6e3abfca83eed105665f5313c9e6223ad7ac48e.jpeg)  
where airDatetxt is:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/2/92bfbb648496cdc6dba73e24138863ccc8557be6.png)

AirDatexformed is the text to date:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/2/522ab2b0e9378c5cd50d97abd7c98da6abefce65.png)

and AirDateFmt is the format:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/6/963dd4b4d1bb5b8cb1c99bdaf8b377433760f365.png)

And the date doesn’t show up at all on the IOS device:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c469a8a6baefef17c287ef9497c185966aeea8fa.jpeg)

Just to finish it off - the html generated in the dev environment has it as a list item which I think looks ok but I’m no expert:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/5/25d4723157a23e771aa3eb3d1c98f62d41302bf0.png)

What am I missing?

---

<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:** [November 7, 2023, 4:39am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/4 "2023-11-07T04:39:38Z")

</div>

What happens if you change the Text to Date column to use medium date format instead of short?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 7, 2023, 4:53am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/5 "2023-11-07T04:53:07Z")

</div>

No difference - I tried all three formats and date & time 🙁

Dev environment is Windows by the way.

---

<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:** [November 7, 2023, 5:05am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/6 "2023-11-07T05:05:23Z")

</div>

Okay, I’m not really sure why that isn’t working for you. I guess my suggestion at this point would be to display the calculated value from each step on the screen. This would at least help identify at which point it’s breaking down on the IOS device.

---

<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:** [November 7, 2023, 11:06pm UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/7 "2023-11-07T23:06:39Z")

</div>

@Darren_Murphy I tried developing the flow on Safari, and it doesn’t return any value for Text to Date column.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/b/2b326760a76174a9fd16cbed8f79b32d4a48be54.png)

However, it works with Format Date directly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0dc7804952391bf2787489d76522eb99a57b72c6.png)

@marshru Can you try just using Format Date and not anything else?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 12:45am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/8 "2023-11-08T00:45:02Z")

</div>

Sure - the text to date pattern was yyyyMMdd but I will try with just date format.

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 1:06am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/9 "2023-11-08T01:06:14Z")

</div>

Ok - so, here’s the problem. It works on the original date field, but that field was never a problem, all the date displays work on that. It does not work on the adjusted date which is created with a snippet of JS to change the date to a different time zone:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/b/fb2b70ab4ac0d49dc51cf41914414b07a31ac910.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c4043c7bc64ce3df4057eb04b14ed128a43ab708.png)

Whatever I do with this date value it will not display properly on IOS. If I just display this column directly it shows “invalid date”, if I display the formatted date from above it is empty. I tried something else a while back based on a youtube video (I think using an Excel formula from memory) and that displayed a date but, unbelievably, the original datetime pre-time zone adjustment (I promise I was using this tzAdj column, I double-checked). I know IOS has some problems with JS generated dates but I would have thought that this would have been worked around with the above fix. I may have to find another way of adjusting the time zone?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 1:17am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/10 "2023-11-08T01:17:55Z")

</div>

I didn’t see this before. Yes, good idea, would have saved @ThinhDinh some time, so sorry both.

The answer is, none of them work on the iPhone. Not even the first Math column. So, it’s the JS date transformation (see below). So, that now being the problem I have to solve, anyone know a reliable time zone adjustment approach that doesn’t require Javascript?

Thanks both of you for your patience by the way and sorry for wasting your time…

---

<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:** [November 8, 2023, 2:01am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/11 "2023-11-08T02:01:44Z")

</div>

Yeah, that JS column will have problems with iOS/MacOS since Apple doesn’t like the underlying format of the date column, I guess.

What exactly are you trying to do there? To convert the date to the signed-in user’s timezone?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 2:15am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/12 "2023-11-08T02:15:36Z")

</div>

Yes, the date returned is in the time zone of the region where the series is made, and i’m converting it to the viewer’s time zone.

---

<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:** [November 8, 2023, 2:32am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/13 "2023-11-08T02:32:22Z")

</div>

Does your date come with the hour part?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 3:01am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/14 "2023-11-08T03:01:15Z")

</div>

Well, it’s a json object returned from the API e.g.  
{“air\_date”:“2023-09-12”, … }  
so, no hour there. But the js which parses air\_date out creates a Date object:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/2/529116b8416d2c7284b95453fab83b16ec95a9f6.png)

and that has an hour.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4a0a6c16fee5802f3d465a7375537eaf620a3103.png)

Problem is that it puts it into the local time zone obviously so I have to the make a time zone adjustment per above.

---

<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:** [November 8, 2023, 3:03am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/15 "2023-11-08T03:03:51Z")

</div>

Is that 10AM the correct time locally?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 3:04am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/16 "2023-11-08T03:04:58Z")

</div>

Nope - no idea where it’s getting that from. It’s 2pm here.

I thought maybe it was the time in the US somewhere (east coast somewhere).

---

<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:** [November 8, 2023, 3:10am UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/17 "2023-11-08T03:10:34Z")

</div>

> [@marshru](#):
>
> Well, it’s a json object returned from the API e.g.  
> {“air\_date”:“2023-09-12”, … }

How did you get the API result in the first place?

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 10:25pm UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/18 "2023-11-08T22:25:20Z")

</div>

using a FetchJSON column with no formatting.

from the TMDB documentation:

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

---

<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:** [November 8, 2023, 10:54pm UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/19 "2023-11-08T22:54:27Z")

</div>

I think it’s only useful if they have the exact hour of airing, say 8PM, then you convert the datetime value to the user’s timezone so they know when exactly that will be aired in their time. If it doesn’t have a time value then your conversion is likely to be wrong.

---

<div class="post-metadata">

**Author:** ![marshru](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@marshru](https://community.glideapps.com/u/marshru)\
**Post date:** [November 8, 2023, 11:26pm UTC](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523/20 "2023-11-08T23:26:19Z")

</div>

True - it won’t be “right”. But it should still work shouldn’t it? Or is the resulting date from the time zone adjustment not a valid date?

[Next page](https://community.glideapps.com/t/how-can-i-make-glide-read-a-date-as-a-string/67523.md?page=2)
