Forum Discussion

FrankDK's avatar
FrankDK
Contributor
3 years ago

Cube View DatePicker, Time Zone and Custom Calculate

We're working on a solution, where users can enter and view a date through a Cube View using the Cell Type Date. The challenge is how OneStream handles date's (datetime) with time-zones. When a date is saved to the backend, it's converted to UTC time-zone. The Date component in the Cube View is also Time-Zone aware, so that it uses the local time of the user, to convert back from the backend UTC to local-time. The challenge with this is 2 fold:

1) Assuming we would calculate a rent for a given period. The user, based in CET time-zone, enters 2022-1-15 using the Gridview. This date is converted to 2022-1-14 as UTC (2022-1-14 23:00:00). Using a Custom Calculate method to calculate the rent from start (2022-1-15), now adds one day more, as the server time is UTC. (don't mention Daylight Saving Zone) 

2) If another user, based in US Central, is reviewing data in the same Grid View (and same POV), this user will see a wrong date, as the server UTC date, is converted to this user's local time

Is there a way to specify in the Cube View, that when using the Date/DateTime picker, that the component should ignore time-zones? Or are there other usable solutions for this issue?

Cheers

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    I don't see this behaviour in my version (7.2.2). I created two users with different cultures (US and Japanese). When they manipulate a cubeview in Data Explorer, pointing to a NonFinancial account in V#YTD, with a column with Cell Type set to Date or Date Time, whichever value they set will get saved in the database as it is - so both users see exactly the same value, not going through any UTC-related mangling.

    As far as I can see, OneStream is simply taking the datetime object and saving the value of its .Ticks method. If you want to manipulate it for some reason (e.g. intercepting it into some event handler), you can reconstruct the object:

    Dim myDate as new Date(yourDataCellObject.CellAmount)