作者:郝春利
转贴请注明出处: http://blog.csdn.net/froole
提取两个时间点的天数差——看上去一个及其单纯的问题,但是,考虑到不同年份、闰年等因素,想要写一个可以广泛使用的却非常麻烦。
以下是loveapple工程中我写的一个提取不同时间点的天数的代码,如有不足,希望各路大虾指正。
转贴请注明出处: http://blog.csdn.net/froole
提取两个时间点的天数差——看上去一个及其单纯的问题,但是,考虑到不同年份、闰年等因素,想要写一个可以广泛使用的却非常麻烦。
以下是loveapple工程中我写的一个提取不同时间点的天数的代码,如有不足,希望各路大虾指正。
- /*
- * $Header$
- * $Author$
- * $Revision$
- * $Date$
- *
- * ====================================================================
- *
- * Copyright (C) 2008 by www.loveapple.cn
- *
- * All copyright notices regarding loveapple and loveapple CoreLib
- * MUST remain intact in the scripts, documents and source code.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser Gene