thieumao

Convert time youtube

Jun 12th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. public static String getVideoDirection(Context context, String time) {
  2.         String str = null;
  3.         PeriodFormatter formatter = ISOPeriodFormat.standard();
  4.         Period p = formatter.parsePeriod(o);
  5.         int h = p.getHours();
  6.         int m = p.getMinutes();
  7.         int s = p.getSeconds();
  8.  
  9.         if (h != 0) {
  10.             str = String.format("%d : %d : %d", h, m, s);
  11.         } else {
  12.             str = String.format("%d : %d", m, s);
  13.         }
  14.         return str;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment