Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String DateStr="2012-05-31T13:48:04Z";
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
- Date d=sdf.parse(DateStr);
- System.out.println(d.getTime());
- Instant.parse( "2012-05-31T13:48:04Z" )
- .toEpochMilli()
- / 1_000L
- Instant instant = Instant.parse( "2012-05-31T13:48:04Z" ) ;
- long millisSinceEpoch = instant.toEpochMilli() ;
- long secondsSinceEpoch = ( millisSinceEpoch / 1_000L ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement