Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java10
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java2
2 files changed, 5 insertions, 7 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
index a8bf8a8195..d262370785 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestampFormat.java
@@ -500,25 +500,23 @@ public class TmfTimestampFormat extends SimpleDateFormat {
if (seconds == -1) {
Date baseDate = super.parse(sb.toString());
- Calendar refTime = Calendar.getInstance(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
+ Calendar refTime = Calendar.getInstance(getTimeZone());
refTime.setTimeInMillis(ref / 1000000);
- Calendar newTime = Calendar.getInstance(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
+ Calendar newTime = Calendar.getInstance(getTimeZone());
newTime.setTimeInMillis(baseDate.getTime());
- int[] fields = new int[] { Calendar.YEAR, Calendar.DAY_OF_YEAR, Calendar.MONTH, Calendar.DATE, Calendar.HOUR, Calendar.MINUTE, Calendar.SECOND };
+ int[] fields = new int[] { Calendar.YEAR, Calendar.MONTH, Calendar.DATE, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND };
for (int field : fields) {
int value = newTime.get(field);
// Do some adjustments...
if (field == Calendar.YEAR) {
value -= 1970;
- } else if (field == Calendar.DATE || field == Calendar.DAY_OF_YEAR) {
+ } else if (field == Calendar.DATE) {
value -= 1;
}
// ... and fill-in the empty fields
if (value == 0) {
newTime.set(field, refTime.get(field));
- } else if (field == Calendar.DAY_OF_YEAR) {
- newTime.set(field, value);
} else {
break; // Get out as soon as we have a significant value
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
index 678110ee53..91b7d35cf9 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
@@ -78,7 +78,7 @@ public class HistogramCurrentTimeControl extends HistogramTextControl {
String string = fTextValue.getText();
long value = 0;
try {
- value = TmfTimestampFormat.getDefaulTimeFormat().parseValue(string, fTraceStartTime);
+ value = TmfTimestampFormat.getDefaulTimeFormat().parseValue(string, getValue());
} catch (ParseException e) {
}
if (getValue() != value) {

Back to the top