Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.util.Date;
  2. import java.text.SimpleDateFormat;
  3.  
  4. public class HelloWorld{
  5.  
  6.      public static void main(String []args){
  7.          
  8.      SimpleDateFormat dateFormat=new SimpleDateFormat("MMM");
  9.         String str="01-mar-2015 09:00:00.011     0  LOGGING_STARTED";
  10.         Date date=null;
  11.         try{
  12.             date= dateFormat.parse(str.substring(3,6));
  13.             System.out.println(date.getTime());
  14.  
  15.  
  16.         }catch(Exception e){
  17.             System.out.println(e.getMessage());
  18.         }  
  19.      }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement