Skip to content

Instantly share code, notes, and snippets.

@stephentu
Created July 3, 2011 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephentu/1062386 to your computer and use it in GitHub Desktop.
Save stephentu/1062386 to your computer and use it in GitHub Desktop.
val d = DateFormat.getDateInstance(DateFormat.SHORT).parse("11/20/1988")
val c = Calendar.getInstance
c.setTime(d)
c.add(Calendar.MONTH, 5)
val d1 = c.getTime()
d1.toString()
res8: java.lang.String = Thu Apr 20 00:00:00 PDT 1989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment