This repository has been archived on 2025-12-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
tcommon-studio-se/org.talend.librariesmanager/resources/java/routines/system/TalendTimestampWithTZ.java
bchen 94141bdd8c Fix Bug TDI-21779 : tOracleSCD type 2 does not work as expected with fields containing timestamps
https://jira.talendforge.org/browse/TDI-21779
1.make TalendDate.parseDate method support to store timezone
2.make tOracleSCD component support "Timestamp With Time Zone" type
merge r91187 & r91295 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@91300 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-25 09:36:44 +00:00

52 lines
1.3 KiB
Java

// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package routines.system;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
/**
* created by bchen on Sep 19, 2012 Detailled comment
*
*/
public class TalendTimestampWithTZ extends Date {
Timestamp ts;
TimeZone tz;
public TalendTimestampWithTZ(Timestamp ts, TimeZone tz) {
super(ts.getTime());
this.ts = ts;
this.tz = tz;
}
public TimeZone getTimeZone() {
return tz;
}
public Timestamp getTimestamp() {
return ts;
}
public Calendar getCalendar() {
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.setTimeInMillis(ts.getTime());
calendar.setTimeZone(tz);
return calendar;
}
}