Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Timezone issue

$
0
0
(For reference: Using Linux and postgres as DB)

Ok, the objective is that I have to add a timestamp to a destination table.

So when I start the job I get the time from the destination database and store it in a VARIABLE.

Several transformations later I do a query that looks like this:

select column1, column2, column3, ...., '${STARTDATE}'::timestamptz columnN from table.

That went well in the development server. But when I went to the QA server, I found that the OS has UCT timezone(-00) and the database has -05 timezone.
The thing is that the method i used takes a pentaho variable which is in UTC (because pentaho uses the timezone if the OS) and paste the value in that query. When the insert occurs, since it has no timezone, the database puts its own.
So If the time in the OS is 10:00:00 UTC the value that gets inserted into the DB is 10:00:00-05, which in fact, should be 05:00:00-05.

There is no problem for example using ? to get the date from a previous step, say input table. In that case pentaho makes the conversion correctly.
But I cannot make that happen, because the value is got in the parent JOB at the start of the run.

I can make the following modification:
select column1, column2, column3, ...., '${STARTDATE}-00'::timestamptz columnN from table.
and it works. But the problem is that if i put this code in Dev it will fail, because the OS is not UTC.

Is there a way to solve this issue?

Thanks

Daniel

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>