java - How to retrieve the date format for a locale -


i've been using dateformat format dates, need pass format locale jquery date widget. how can format?

update:

to clarify, need pattern in java can output elsewhere. e.g. in javascript might want create string date format in it:

$('#datepicker').datepicker({'dateformat':'dd/mm/yy'}) 

you can date pattern using

((simpledateformat) dateformat.getdatetimeinstance(dateformat.long, dateformat.long, locale.uk)).topattern() 

or if need date

((simpledateformat) dateformat.getdateinstance(dateformat.short, locale.uk)).topattern() 

api: simpledateformat.topattern(), dateformat.getdatetimeinstance(), dateformat.getdateinstance()

second question how convert jquery specific format pattern.

java date formatting. vs jquery datepicker date formatting

  • day of year in java d, in jquery o
  • short year in java yy, in jquery y
  • long year in java yyyy, in jquery yy
  • month without leading zeros in java m, in jquery m
  • month leading zeros in java mm, in jquery mm
  • month name short in java mmm, in jquery m
  • month name long in java mmmm in jquery mm -

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -