Hi,
I have data coming from different countries and cities with their own timestamp.
On my visualisations in Workshop I want any of my users to be able to see the same things.
Meaning If a user from CEST is looking at his data hour by hour for a specific day, he should see his data from 00:00 to 00:00 the next day.
I want another user from any other country with a different timezone to see the same thing and vice versa.
I tried different options from a data point of view as well as on the Ontology side and it seems none or working.
How can I ādeactivateā the timestamp linked to a timezone and just have the same timestamp rendered for everyone similarly.
Thanks.
Hi @BenjaminB,
Iām I understand correctly, what you want can be configured from the ontology manager.
- Go to the object type where you have the TS property you want to display
- Select the TS property
- Go to display
- Configure like static TZ, and select the best for your use case
Hope this helps,
1 Like
Thanks for the options, I think Iāve found some inconstancy
I took the same variable containing my objects.
Iāve set up the timestamp to a fixed timezone: āUTCā.
Now in my Workshop depending on the visualisation I have 3 different output:
- First in the object table it says 22:00 the day before while in the dataset it is given 00:00z.
- Then If I put my objects in a chart the output is what I want.
- But if I use it with a typescript function (for some modularity), it gives me the output with a +2h (the UTC my computer is set).
While for all those 3 what I want to have is the same one which is midnight regardless of the UTC the user is at.
This behavior is expected.
Workshop will display everything normalized to the timezone (TZ) youāve selected. However, the original timezone is still stored in the object type. Make sure there is no other formatting overriding the one from the ontology.
When using functions, this stored timezone will be applied unless you convert it back to match the timezone used in the Ontology Managerās property display settings.
In TypeScript, install moment-timezone and do this:
import * as moment from 'moment-timezone';
let date = '2024-10-21T10:00:00Z'; // Your timestamp in UTC
// Convert to a specific timezone, e.g., 'America/New_York', use your desired TZ here.
let newYorkTime = moment.tz(date, 'America/New_York').format();
console.log(newYorkTime);
Please let me know if this works.
1 Like
Hi,
I made some fix from the Ontology side to have the object table and native chart showing similar information by simply switching from ISO instant with a static timezone to āData and Timeā still in static timezone:
Now for the typescript function I tried the solution you proposed but I had to change it to a string output and not an IRange which isnāt ideal visually:
Do you have a solution while keeping the IRange format ?
Iām gonna continue looking for an ideal solution in the meantime.
thanks for the support.
Hi @BenjaminB ,
Iām happy that we are making progress! This is what the community is for.
Make the following change to keep a TS instead of a string
let newYorkTimeTimestamp = moment.tz(date, 'America/New_York').valueOf();
Regarding IRange I think thatās a different issue.
Iād love to see what you had in the function. Maybe we can start a new thread on it so we can help you create the IRange.
You can find more details about custom aggregation in Palantir Foundry by referring to the official foundry documentation.
Hi Arukavina,
Iām gonna open a new thread regarding the typescript / IRange problem iām facing.
Iāve tried the .valueOf() but Iām facing other problem. Iām gonna resume everything in the new thread.
1 Like