# Relative Time + Experimental Code to Translate it?

**URL:** https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497
**Category:** Ask for Help
**Created:** [November 14, 2021, 11:49am UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497 "2021-11-14T11:49:57Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 1:00pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/21 "2021-11-20T13:00:55Z")

</div>

Both start and end dates are required and you can’t create a column that gives you a now() date (current date and time) because calculated columns will only refresh when the data that they reference changes. Try using =NOW() in a Google Sheet cell. It will give you the current date and time but it will not change until you edit it again. Even if you use it in a formula the only time the formula will recalculate will be if you reference some other data column that changes.

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 1:08pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/22 "2021-11-20T13:08:14Z")

</div>

Can I give p1, p2 fixed dates?  
Thks.

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 1:16pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/23 "2021-11-20T13:16:04Z")

</div>

Yes

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 1:25pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/24 "2021-11-20T13:25:30Z")

</div>

Still not

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

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 1:31pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/25 "2021-11-20T13:31:16Z")

</div>

Stupid question, but when I tried to run the code there, it says I require a login: could that be that I just cannot load the “imported luxon” ?

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

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 1:54pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/26 "2021-11-20T13:54:21Z")

</div>

I misunderstood your question, I thought you were going to create two columns with fixed dates and pick them for p1 and p2 parameters. You could pass fixed strings I guess but they would have to be in ISO string date format like this 2021-12-23T14:35:46.700Z or 2020-10-20T10:30:40.000Z

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 1:57pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/27 "2021-11-20T13:57:02Z")

</div>

Correct, you need to log in to [onecomplier.com](http://onecomplier.com) in order to use URLs in you code.

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 1:57pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/28 "2021-11-20T13:57:11Z")

</div>

OK. Where can I find a Date converter to this ISO format? I’m usually DD/MM/AAAA, HH:MM:SS. Thks & Sorry for the trouble. But it’s a side-side project, and we’re on 6 h or more TZ split, so, my apologies for inconvenience & delay, George.

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 1:58pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/29 "2021-11-20T13:58:34Z")

</div>

Just use date columns for the two parameters, the conversion will be automatic.

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 2:05pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/30 "2021-11-20T14:05:45Z")

</div>

Ahem…

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

---

<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 20, 2021, 2:08pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/31 "2021-11-20T14:08:15Z")

</div>

I believe this is an issue that affects several of the Date plugins.

@George-Glide I raised an [issue](https://github.com/glideapps/glide-code-columns/issues/86) about this a week or so ago.

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 2:08pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/32 "2021-11-20T14:08:23Z")

</div>

Sorry, I have no idea why it isn’t working for you.

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 2:10pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/33 "2021-11-20T14:10:35Z")

</div>

At least we tried. Thks, George.  
I’ll let you know if I come up with sth.  
As a rule, knowing what the exact format is required would be helpful in fields, Parameter’s placeholders.  
Enjoy your week-end 🌸

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 2:12pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/34 "2021-11-20T14:12:27Z")

</div>

Do you happen to have a converter to ISO date format? 😇, Darren. Just in case.  
That could increase my chances to get date columns work. And separate the French translation work once dates are “clean”.

---

<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 20, 2021, 2:14pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/35 "2021-11-20T14:14:47Z")

</div>

You could extract the component parts from the date using a series of math columns, and then stitch them back together using a template column. But that’s kinda silly. I’d prefer to just wait until the plugins are fixed.

---

<div class="post-metadata">

### Author: ![L.M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/l.m/32/46371_2.png) [@L.M](https://community.glideapps.com/u/L.M)
#### Post date: [November 20, 2021, 2:17pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/36 "2021-11-20T14:17:11Z")

</div>

😅  
Yes, I had a bad feeling about this too 🤠👽, according to your comments here and there.  
Tricky Business.  
Now, do you happen to know if Glide stores the user’s Time Zone? Or do we have to “catch it or lose it”?  
Thks

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 2:24pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/37 "2021-11-20T14:24:20Z")

</div>

@Darren_Murphy @L.M Do you have a sample app where the dates do not work? The code is assuming that the dates are coming in as iso date strings but apparently, they are not in all cases. I guess I could add some tests on the passed-in variables to see what format they are. I’d be curious to know what the following Code/Javascript column returns

```auto
return (typeof p1) + " - " + p1

```

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

---

<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 20, 2021, 2:33pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/38 "2021-11-20T14:33:45Z")

</div>

> [@George-Glide](#):
>
> Do you have a sample app where the dates do not work?

I have issues with the Date Plugins in all of my apps. I don’t believe it’s anything to do with the apps, but rather my locale/date settings that cause them to fail or give incorrect results.

> [@George-Glide](#):
>
> I’d be curious to know what the following Code/Javascript column returns

 ![Screen Shot 2021-11-20 at 10.27.08 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/5/6559518727005d459f2a058ecfaeb7d1b477cec9.png)

Interestingly, that’s being interpreted as a date string in mm/dd/yyyy format. But, my local machine does not use that format. So any results I get are either incorrect (in the case of ambiguous dates - where 11th November is interpreted as 9th September), or they fail (in the case of non-ambiguous dates - where 20th November is interpreted as 11th of the 20th month. ie. an invalid date)

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 2:40pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/39 "2021-11-20T14:40:19Z")

</div>

OK, I’ll have to think about this discovery.

---

<div class="post-metadata">

### Author: ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)
#### Post date: [November 20, 2021, 2:44pm UTC](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497/40 "2021-11-20T14:44:27Z")

</div>

What do you get with this:

```auto
return new Date().toJSON()
```

[Previous page](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497.md?page=1)

[Next page](https://community.glideapps.com/t/relative-time-experimental-code-to-translate-it/34497.md?page=3)
