turt2live

Untitled

Dec 2nd, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. private double getBackgroundExpire(String command){
  2.     command = command.replaceAll("y", "*31536000000+");
  3.     command = command.replaceAll("mo", "*2628000000+");
  4.     command = command.replaceAll("w", "*604800000+");
  5.     command = command.replaceAll("d", "*86400000+");
  6.     command = command.replaceAll("h", "*3600000+");
  7.     command = command.replaceAll("m", "*60000+");
  8.     command = command.replaceAll("s", "*1000+");
  9.     command = command.substring(0, command.length()-1);
  10.     Double ret = 0.0;
  11.     ret = new Expression(command).resolve();
  12.     //System.out.println(ret/1000);
  13.     return ret;
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment