If this is Java you're asking about, then convert it to a Calendar object somehow (it isn't part of the standard Java API so you would have to find its documentation and read that). Thenand finally convert it somehow back to a datetime object.
If it's Javascript, then say so and a moderator will move the question to the Javascript forum.