Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def verifyToken(expiration: String) = {
- //"2014-05-28T22:19:10Z"
- val exp_format = expiration.split("T")(1).split("Z")(0) + " " + expiration.split("T")(0)
- val sdf = new SimpleDateFormat("HH:mm:ss yyyy-M-DD")
- val token_date = sdf.parse(exp_format)
- val current_date = new Date()
- val difference = current_date.getTime() - token_date.getTime();
- if (difference > 0) {
- true
- } else {
- false
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement