s.paskevics Posted December 14, 2014 Share Posted December 14, 2014 I have String "14121114235959" -> (YYMMDD24MISS),How i can converted this string to date?In oracle i converte with function TO_DATE("14121114235959", 'YYMMDDHH24MISS') Link to comment Share on other sites More sharing options...
Solution Java_Jasper Posted December 18, 2014 Solution Share Posted December 18, 2014 I belive there are two ways to acomplish this witht he latter being best practices.1) You could hard code it like so:String date = 14121114235959$P{FormattedDate} = new SimpleDateFormat("EEEE MMM dd, yyyy")$P{FormattedDate}.format($P{date}) ;2) Or you could use the JVMBut the better choice would be to use the JVM like so:DateFormat.getDateInstance(DateFormat.MEDIUM, $P{REPORT_LOCALE}).format( $F{FormattedDate} )DateFormat.getDateInstance(DateFormat.LONG, $P{REPORT_LOCALE}).format( $F{FormattedDate} ) This way it automatically reflects formatting choices already chosen by the user on his own PC. Enjoy! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now