Skip to content

Commit

Permalink
0001426 - Fix issue where postgres datetimestamp with timezone not pr…
Browse files Browse the repository at this point in the history
…operly formatted when timezone hour = 0 and timezone minutes < 0.
  • Loading branch information
gwilmer committed Sep 24, 2013
1 parent 69f23b1 commit 72ae573
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -40,10 +40,11 @@ public PostgreSqlTriggerTemplate(ISymmetricDialect symmetricDialect) {
dateTimeWithTimeZoneColumnTemplate =
"case when $(tableAlias).\"$(columnName)\" is null then '' else " +
" case " +
" when extract(timezone_hour from $(tableAlias).\"$(columnName)\") < 0 then " +
" when extract(timezone_hour from $(tableAlias).\"$(columnName)\") <= 0 and " +
" extract(timezone_minute from $(tableAlias).\"$(columnName)\") < 0 then " +
" '\"' || to_char($(tableAlias).\"$(columnName)\", 'YYYY-MM-DD HH24:MI:SS.US ')||'-'|| " +
" lpad(cast(abs(extract(timezone_hour from $(tableAlias).\"$(columnName)\")) as varchar),2,'0')||':'|| " +
" lpad(cast(abs(extract(timezone_minute from $(tableAlias).\"$(columnName)\")) as varchar), 2, '0') || '\"' " +
" lpad(cast(abs(extract(timezone_minute from $(tableAlias).\"$(columnName)\")) as varchar), 2, '0') || '\"' " +
" else " +
" '\"' || to_char($(tableAlias).\"$(columnName)\", 'YYYY-MM-DD HH24:MI:SS.US ')||'+'|| " +
" lpad(cast(extract(timezone_hour from $(tableAlias).\"$(columnName)\") as varchar),2,'0')||':'|| " +
Expand Down

0 comments on commit 72ae573

Please sign in to comment.