Commit 267b9d95 authored by ='s avatar =

hungtt-commit fix timzoneUtils

parent 1057211b
...@@ -5,14 +5,11 @@ ...@@ -5,14 +5,11 @@
*/ */
package com.viettel.campaign.utils; package com.viettel.campaign.utils;
import org.apache.log4j.Logger;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
/** /**
* *
...@@ -86,7 +83,7 @@ public class TimeZoneUtils { ...@@ -86,7 +83,7 @@ public class TimeZoneUtils {
public static String toDateStringWithTimeZone(Date date, TimeZone tz){ public static String toDateStringWithTimeZone(Date date, TimeZone tz){
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
sdf.setTimeZone(tz); sdf.setTimeZone(tz);
return sdf.format(date); return date == null ? null : sdf.format(date);
} }
public static TimeZone getZone(Long timeZone){ public static TimeZone getZone(Long timeZone){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment