package org.knowm.xchange.quadrigacx;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.exceptions.ExchangeException;

/**
 * A central place for shared QuadrigaCx properties
 */
public final class QuadrigaCxUtils {

  private static final String TIMEZONE = "UTC";
  private static final String PATTERN = "yyyy-MM-dd HH:mm:ss";

  /**
   * private Constructor
   */
  private QuadrigaCxUtils() {

  }

  /**
   * Format a date String for QuadrigaCx
   *
   * @param dateString
   * @return
   */
  public static Date parseDate(String dateString) {
    try {
        // SimpleDateFormat is not thread safe, there fore create a new instance every time
        SimpleDateFormat df = new SimpleDateFormat(PATTERN);
        df.setTimeZone(TimeZone.getTimeZone(TIMEZONE));
      return df.parse(dateString);
    } catch (ParseException e) {
      throw new ExchangeException("Illegal date/time format", e);
    }
  }

  public static String currencyPairToBook(CurrencyPair currencyPair) {
    return currencyPair.base.getCurrencyCode().toLowerCase() + "_" + currencyPair.counter.getCurrencyCode().toLowerCase();
  }

}

@@ -463,16 +463,201 @@
 :mm:ss%22;
+%0A  private static final SimpleDateFormat DATE_FORMAT;%0A  %0A  static %7B%0A      DATE_FORMAT = new SimpleDateFormat(PATTERN);%0A      DATE_FORMAT.setTimeZone(TimeZone.getTimeZone(TIMEZONE));%0A  %7D
 %0A%0A  /**%0A
@@ -876,24 +876,57 @@
 %0A    try %7B%0A 
+     synchronized (DATE_FORMAT) %7B
        // Si
@@ -969,179 +969,54 @@
 here
- 
 fore 
-create a new instance every time%0A        SimpleDateFormat df = new SimpleDateFormat(PATTERN);%0A        df.setTimeZone(TimeZone.getTimeZone(TIMEZONE));%0A      return df
+synchronize it%0A        return DATE_FORMAT
 .par
@@ -1031,16 +1031,24 @@
 tring);%0A
+      %7D%0A
     %7D ca

synchronize the usage of SimpleDateFormat instead of creating new instance