Skip to content

Commit

Permalink
Merge pull request #4834 from rizer1980/PR/bybit-date-conversion-fix
Browse files Browse the repository at this point in the history
[bybit] [deribit] fix date parse locale
  • Loading branch information
timmolter authored Apr 20, 2024
2 parents c8bed30 + 78d6756 commit 10c3448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.knowm.xchange.bybit.dto.BybitCategory;
import org.knowm.xchange.bybit.dto.BybitResult;
import org.knowm.xchange.bybit.dto.account.allcoins.BybitAllCoinBalance;
Expand Down Expand Up @@ -44,7 +45,7 @@

public class BybitAdapters {

private static final SimpleDateFormat OPTION_DATE_FORMAT = new SimpleDateFormat("ddMMMyy");
private static final SimpleDateFormat OPTION_DATE_FORMAT = new SimpleDateFormat("ddMMMyy", Locale.US);
public static final List<String> QUOTE_CURRENCIES = Arrays.asList("USDT", "USDC", "BTC", "DAI");

public static Wallet adaptBybitBalances(List<BybitCoinWalletBalance> coinWalletBalances) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.knowm.xchange.currency.Currency;
Expand Down Expand Up @@ -53,7 +54,7 @@ public class DeribitAdapters {
private static final String PERPETUAL = "PERPETUAL";
private static final int CURRENCY_SCALE = 8;
private static final ThreadLocal<DateFormat> DATE_PARSER =
ThreadLocal.withInitial(() -> new SimpleDateFormat("ddMMMyy"));
ThreadLocal.withInitial(() -> new SimpleDateFormat("ddMMMyy", Locale.US));

public static String adaptInstrumentName(Instrument instrument) {
if (instrument instanceof FuturesContract) {
Expand Down

0 comments on commit 10c3448

Please sign in to comment.