Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Date;
- import java.text.SimpleDateFormat;
- public class HelloWorld{
- public static void main(String []args){
- SimpleDateFormat dateFormat=new SimpleDateFormat("MMM");
- String str="01-mar-2015 09:00:00.011 0 LOGGING_STARTED";
- Date date=null;
- try{
- date= dateFormat.parse(str.substring(3,6));
- System.out.println(date.getTime());
- }catch(Exception e){
- System.out.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement