1 Reply Latest reply on Jun 24, 2010 10:52 PM by 843810

    Localized Date format

      we need to display date in spanish local, for that we are using below code, but the requirment is month of first character has to come in Capital, please don't suggest explicitly convert of first character of string.

      SimpleDateFormat formater = new SimpleDateFormat("dd MMMM yyyy", new Locale("es"));
      TimeZone tz = TimeZone.getTimeZone("Europe/Paris");
      System.out.println("Date = "+formater.format(new Date()));

      Out put
      Date = 27 mayo 2010
        • 1. Re: Localized Date format

          As you probably already know the localization is correct. In Spanish, the months of the year are not capitalized.
          You are probably localizing for a US company for US Hispanics.
          You would have to make a custom Locale with a custom resource bundle with translations of months that are capitalized.

          So, just cap the first letter. It is by far the quickest method.

          Eugenio Alvarez