Timezone offsets in AI component for current time

I am using the now function to determine the current time. i am displaying the value at the top of the screen. 11:44 AM

I need to place a current time bar along my timeline. As the image shows it lists 04:44 reflecting the 7 hour offset for PST. I need to both display the correct local time in the widget AND have it positioned correctly on the timeline. Appreciate help of link to existing question. THANKS

1 Like

The custom AI component is really just a lot of trial and error. So if I’m understanding correctly, you have two issues, one being that it should show 11:44 instead of 4:44, and the other meeting the positioning? Is that correct? Can you share how the component is configured so I can see the input/output parameters? Could you also share your prompts just so I have some context of what you asked it?

1 Like

thanks Jeff. YES to the two issues.

The timeline along the top was generated by the AI component. I had to explicitly ask it to use UTC time in order for it to display the times I entered for each start / stop stage. e.g. I entered 5:00 AM start time and the bar was displaying 10:00 PM (the previous day - I am PST so it was off 7 hours) - I think this may be one thing that is messing with the ability to place the current time at the right position.

I have tried different ways to generate a current time. 1- i simply specify in the prompt to use current time, 2 - i have tried using glide column for current time using the NOW() function

3- I have also tried modifying the time in the current time column but I was going around in circles.

NOTE: I can explicitly tell the prompt to draw the current time bar at a specific point on the timeline but it is not dynamic so therefore not useful.

Appreciate the help.

1 Like

Still would like to see the configuration so I know exactly what you are passing in for parameters.

Honestly there is no reason to pass in a Now time value. The javascript in the code that the AI writes can easily handle that and it should be based on device time so no need to mess around with timezone offsets.

As for move the time along the bar, I don’t think that would be too bad, but I would start with the current time thing first.

1 Like

ok i will remove the column and simply use the js for the current time. Not sure what “configuration” you are referring to. the tables? the prompt?, both?

1 Like

The right side of the builder where you enter the prompts and configure the connected columns and actions for the component.

By letting the component itself figure out the times you also won’t have that 10 second delay like you do with Now. It will be real time and a lot smoother.

1 Like

i started over with a blank component that only draws the timeline and does not display the segments and it works great. thanks!

2 Likes

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