# š System/GMT Time - Solved!

Donāt trust anything that Jeff guy says:

Iām looking at this closer. I think I get whatās happening now. I think it only affects you for the last 8 hours of the last day of the month. I wonāt see it until the first 5 hours of October 1st since Iām on the other side of GMT.

The confusing thing here that when you add GMT to the date/time in a template column, then glide assumes the date/time as if it was actually GMT. So when you show that GMT time or pick out the parts of the GMT date, then the equivalent of Singapore date/time is 8 hours after the GMT date/time, which was pushing the date to Oct 1st. My logic to add or subtract 24 is applying somewhat correctly, but in the wrong direction. Itās supposed to offset a difference of -16 by adding 24, but instead it subtracts 24, which gives you an offset of -40.

I quickly tried a change which fixes it on your end of the world, but not on mine. Iāll have to rethink the logic a little bit and hopefully update the formula. Basically Iām trying to use the below part of the formula to get a -1, 0, or +1 if the month changes, then multiply that value by 24, so the hour difference can be adjusted properly if it crosses different days. I have some ideas to fix it, but Iāll have to do some good testing. Iāll let you know when I have it fixed.

``````(24
*
(ABS(day(GMT)-day(LDT))
/
(day(GMT)-day(LDT)))
)
``````
1 Like

yup!

That explains why it worked for my boy in Melbourne last night when I asked him to test - because it had already ticked over into the new month down under. It also explains why it didnāt work for our friend in Vietnam on his Windows machine - because it was still in that 8 hour āblack holeā period in Vietnam. So the OS theory was just a red herring

At least we know whatās going on now, and the good news is we have a whole month (almost) to figure out how to fix it!

Edit: Just quickly tested for a few days other than the first/last day of the month, to make sureā¦

2 Likes

really? nobody mentioning 12h off GS vs Glide? and different 0 dates? and why going this circus when we can relate to absolute time numbers?
time Apps by StructureArt:

I have no idea what you mean by that.

I also have no idea what you mean by that.

The reason I am persisting with this is because itās a pure Glide solution that requires no Spreadsheet formulas, and no experimental columns, and nothing else external to Glide other than the users own device. If you can show me an alternative solution that meets those criteria, then Iām all ears

2 Likes

try to put ā0ā on Date cell format in GS and Glide and see what happensā¦ Glide is the base origin GS app creatorā¦ so ā¦ letās stick to GS formats
@Darren_Murphy by absolute numbers I mean time duration, related to TIME NOW on active Appā¦ and I just post 2 apps that have this problem solved

@Darren_Murphy Grrr, this would be so much easier if glide would recognize a template date as a date for date math. They will let me pick out parts of a template date, such as Day and Hour, but it wonāt work for simple date math. Not sure why.

But I did figure it out and I think I have it fixed. I tested with both my timezone of GMT-5 and your timezone of GMT+8. I also tested within a couple hours of the end of the day on Sept 30th and the beginning of the day on Oct 1st. I also tested a random day in the middle of the month. In all cases it showed me the correct offset and correct GMT time regardless of user timezone.

BEFORE:

AFTER:

Here is the full replacement formula:

``````(HOUR(gmt)-HOUR(ldt))

+

(24 * (
ABS((MONTH(gmt)*100+DAY(gmt))
-(MONTH(ldt)*100+DAY(ldt)))
/
((MONTH(gmt)*100+DAY(gmt))
-(MONTH(ldt)*100+DAY(ldt)))
))

+

(MINUTE(gmt)-MINUTE(ldt))/60
``````

Got it fixed with a whole month to spare.

I will update the screenshot in the original post momentarily.

2 Likes

TIME is a var that relates to a user position in space and speedā¦ thatās why I will suggest using durationā¦ and recalculate time in USC for usersā¦ and have anchor point in GS for App developer

Nice!

But, but, butā¦ it breaks on Dec 31

At first I thought that might have been a leap year thing, but it seems to be all years (see Dec 31, 2023)

PS. But you did mange to extend the deadline by a couple of months

1 Like

Come on man, youāre killing me. Hehe, I know how to fix that now. Give me a sec.

1 Like

guysā¦ have fun cracking time formatsā¦ like a said ā¦ make a duration as absoluteā¦ and add to timeā¦ my apps are unbreakable for customers around the world! and they always come for more.

Soā¦donāt change your system to next yearā¦it must expire most website certificates, so everything started to crash on me.

Can you try this version quick and let me know if it looks good? If so, Iāll update my screenshotsā¦again.

``````(HOUR(gmt)-HOUR(ldt))

+

(24 * (
ABS((YEAR(gmt)*10000+MONTH(gmt)*100+DAY(gmt))
-(YEAR(ldt)*10000+MONTH(ldt)*100+DAY(ldt)))
/
((YEAR(gmt)*10000+MONTH(gmt)*100+DAY(gmt))
-(YEAR(ldt)*10000+MONTH(ldt)*100+DAY(ldt)))
))

+

(MINUTE(gmt)-MINUTE(ldt))/60
``````
2 Likes

No dice, Iām afraidā¦

Sorry, I had gmt in the ldt spots. I updated the above formula.

Wonderful!!

I never doubted you for a second

2 Likes

Finally!

1 Like

Yes. You have my permission to get some rest now

3 Likes

Give me something more challenging next time.

4 Likes

Itās still buggy https://embarrassed-shoe-5921.glideapp.io/

Itās working for me?

I access by computer