• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Subtract Minutes from a DateTime object

 
Paul Fryer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a datetime object and I want to subtract 30 minutes from it and be able to reference a datatime object with the 'new' datetime.

How do I do this?
 
Paul Clapham
Sheriff
Pie
Posts: 20978
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "datetime" object?

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.
 
pham thanh tung
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I confused to set() function
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's a Joda DateTime object you are talking about then look at the javadoc for it, specifically the minusXXX methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic