Android Date Time Format Pattern -


i want know if there way format being used system. of using joda time library , manually specifying foramt expect date in.

private final datetimeformatter formatter = datetimeformat.forpattern("yyyy-mm-dd"); localdate date = localdate.parse(event_date, formatter); 

this of course not best idea hardcode pattern,so there way can pattern system?

you can use this:

dateformat formatter = dateformat.getdateinstance(dateformat.short, locale.getdefault()); string pattern       = ((simpledateformat)formatter).topattern(); string localpattern  = ((simpledateformat)formatter).tolocalizedpattern(); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -