fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.text.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone {
  10. public static void main (String[] args) throws java.lang.Exception {
  11. DateFormatSymbols sym = DateFormatSymbols.getInstance(new Locale("es","ar"));
  12. sym.setMonths(new String[]{"Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre" });
  13. sym.setShortMonths(new String[]{"Ene","Feb","Mar","May","Jul","Ago","Sep","Oct","Nov","Dic" });
  14. SimpleDateFormat date = new SimpleDateFormat("dd-MMM-yyyy", sym);
  15. System.out.println(date.format(new Date(2014-1900,0,1)));
  16.  
  17. SimpleDateFormat date2 = new SimpleDateFormat("dd-MMMM-yyyy", sym);
  18. System.out.println(date2.format(new Date(2014-1900,0,1)));
  19. }
  20. }
Success #stdin #stdout 0.11s 380928KB
stdin
Standard input is empty
stdout
01-Ene-2014
01-Enero-2014