-
26 Mar 2012 12:32 PM #1
Answered: Subtract a lot of seconds from any date
Answered: Subtract a lot of seconds from any date
From the Ext help I have thus far
but a guess is Ext.Date.DATE in the help is given Ext.Date.Day ,-5 to subtract 5 days. How can I use this method to convert strings ?Code:var dt1 = Ext.Date.add(new Date(1989,11,17,3,24,0);, Ext.Date.DATE, -5);
thanks
-
Best Answer Posted by mitchellsimoens
Like this?
Code:var seconds = 5 * 24 * 60 * 60 * -1; //5 days worth of seconds var date = Ext.Date.add(new Date(1989,11,17,3,24,0), Ext.Date.SECOND, seconds);
-
27 Mar 2012 4:31 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
What do you mean convert strings?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
27 Mar 2012 5:59 AM #3
Sorry I meant how can I convert a lot of seconds from this date. I have a chunk of seconds , here it tells me how to subtract 5 days. That doesn't help with my problem. How can I subtract seconds and be sure not to have a problem with leap years etc..
-
27 Mar 2012 6:05 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
Like this?
Code:var seconds = 5 * 24 * 60 * 60 * -1; //5 days worth of seconds var date = Ext.Date.add(new Date(1989,11,17,3,24,0), Ext.Date.SECOND, seconds);
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Apr 2012 5:04 AM #5
Once again you are right monsieur - thanks.


Reply With Quote