- 浏览: 7325892 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
package util{
import mx.formatters.DateFormatter;
import mx.utils.ObjectUtil;
import mx.utils.StringUtil;
public class DateUtils {
// Days of week
public static const MONDAY:String = "monday";
public static const TUESDAY:String = "tuesday";
public static const WEDNESDAY:String = "wednesday";
public static const THURSDAY:String = "thursday";
public static const FRIDAY:String = "friday";
public static const SATURDAY:String = "saturday";
public static const SUNDAY:String = "sunday";
// Months of year
public static const JANUARY:String = "january";
public static const FEBRUARY:String = "february";
public static const MARCH:String = "march";
public static const APRIL:String = "april";
public static const MAY:String = "may";
public static const JUNE:String = "june";
public static const JULY:String = "july";
public static const AUGUST:String = "august";
public static const SEPTEMBER:String = "september";
public static const OCTOBER:String = "october";
public static const NOVEMBER:String = "november";
public static const DECEMBER:String = "december";
// Date parts
public static const YEAR:String = "fullYear";
public static const MONTH:String = "month";
public static const WEEK:String = "week";
public static const DAY_OF_MONTH:String = "date";
public static const HOURS:String = "hours";
public static const MINUTES:String = "minutes";
public static const SECONDS:String = "seconds";
public static const MILLISECONDS:String = "milliseconds";
public static const DAY_OF_WEEK:String = "day";
// Numeric value of "last", to get last item for a specific time
public static const LAST:Number = -1;
// Date masks
public static const SHORT_DATE_MASK:String = "MM/DD/YY";
public static const MEDIUM_DATE_MASK:String = "MMM D, YYYY";
public static const LONG_DATE_MASK:String = "MMMM D, YYYY";
public static const FULL_DATE_MASK:String = "EEEE, MMMM D, YYYY";
// Time masks
public static const SHORT_TIME_MASK:String = "L:NN A";
public static const MEDIUM_TIME_MASK:String = "L:NN:SS A";
// TZD = TimeZoneDesignation = GMT + or - X hours, non-standard, requires a slight hack
public static const LONG_TIME_MASK:String = MEDIUM_TIME_MASK + " TZD";
// Internal values for using in date/time calculations
private static const SECOND_VALUE:uint = 1000;
private static const MINUTE_VALUE:uint = DateUtils.SECOND_VALUE * 60;
private static const HOUR_VALUE:uint = DateUtils.MINUTE_VALUE * 60;
private static const DAY_VALUE:uint = DateUtils.HOUR_VALUE * 24;
private static const WEEK_VALUE:uint = DateUtils.DAY_VALUE * 7;
// Internal variable used in date/time formatting
private static var _dateFormatter:DateFormatter;
private static function get dateFormatter():DateFormatter {
if ( !_dateFormatter ) {
_dateFormatter = new DateFormatter;
}
return _dateFormatter;
}
// a generic object for holding day of the week values
private static var _objDaysOfWeek:Object = null;
public static function get objDaysOfWeek():Object {
if ( !_objDaysOfWeek ) {
_objDaysOfWeek = {};
_objDaysOfWeek[ DateUtils.SUNDAY ] = 0;
_objDaysOfWeek[ DateUtils.MONDAY ] = 1;
_objDaysOfWeek[ DateUtils.TUESDAY ] = 2;
_objDaysOfWeek[ DateUtils.WEDNESDAY ] = 3;
_objDaysOfWeek[ DateUtils.THURSDAY ] = 4;
_objDaysOfWeek[ DateUtils.FRIDAY ] = 5;
_objDaysOfWeek[ DateUtils.SATURDAY ] = 6;
}
return _objDaysOfWeek;
}
// a generic object for holding month values
private static var _objMonth:Object = null;
public static function get objMonth():Object {
if ( !_objMonth ) {
_objMonth = {};
_objMonth[ DateUtils.JANUARY ] = 0;
_objMonth[ DateUtils.FEBRUARY ] = 1;
_objMonth[ DateUtils.MARCH ] = 2;
_objMonth[ DateUtils.APRIL ] = 3;
_objMonth[ DateUtils.MAY ] = 4;
_objMonth[ DateUtils.JUNE ] = 5;
_objMonth[ DateUtils.JULY ] = 6;
_objMonth[ DateUtils.AUGUST ] = 7;
_objMonth[ DateUtils.SEPTEMBER ] = 8;
_objMonth[ DateUtils.OCTOBER ] = 9;
_objMonth[ DateUtils.NOVEMBER ] = 10;
_objMonth[ DateUtils.DECEMBER ] = 11;
}
return _objMonth;
}
public function DateUtils() {
}
/**
*
* 添加或减少天数
*/
public static function addDay(date:Date,days:int):Date
{
if(date!=null)
{
date.setDate(days);
}
return date;
}
/**
* 两个日期相差的天数
*
*/
public static function daysOfDates(date0:Date,date1:Date):int
{
var days0:Number=date0.time;
var days1:Number=date1.time;
var days:Number=(days0-days1)/DAY_VALUE;
return days;
}
/**
* 判断时间是否在开始和结束时间之间
*
*/
public static function isBetween(fromdate:Date,todate:Date,current:Date):Boolean
{
if(ObjectUtil.dateCompare(fromdate,current)!==1&&ObjectUtil.dateCompare(todate,current)!=-1)
{
return true;
}
return false;
}
/**
*位于某个时间之后
*/
public static function after(date0:Date,date1:Date):Boolean
{
if(ObjectUtil.dateCompare(date0,date1)==1)
{
return true;
}
return false;
}
/**
*位于某个时间之前
*/
public static function before(date0:Date,date1:Date):Boolean
{
if(ObjectUtil.dateCompare(date0,date1)==-1)
{
return true;
}
return false;
}
/**
*两个时间相等
*/
public static function equals(date0:Date,date1:Date):Boolean
{
if(ObjectUtil.dateCompare(date0,date1)==0)
{
return true;
}
return false;
}
/**
* @private
*
* This function will remove any invalid characters from the date/time mask based upon a pattern
*
* @param mask The string for matching
* @param pattern The valid characters for this mask
* @param defaultValue The default value to return to the calling page should the mask not match the pattern
*
* @return Returns a validated <code>mask</code> based upon the original pattern
*/
private static function removeInvalidDateTimeCharacters( mask:String, pattern:String, defaultValue:String ):String {
// test for invalid date and time characters
if ( mask.replace( new RegExp( pattern, "ig" ), "" ).length > 0 ) {
// if user is passing an invalid mask, default to defaultValue
mask = defaultValue;
}
// temporarily replace TZD with lowercase tzd for replacing later
return mask.replace( new RegExp( "TZD", "i" ), "tzd" );
}
/**
* Formats a date into a certain date/time format
*
* @param date The date to format
* @param mask How the date should be formatted
*
* @return A formatted date
*/
public static function dateTimeFormat( date:Date, mask:String="MM/DD/YYYY L:NN:SS A" ):String {
return buildDateTime( date, mask, "(Y|M|D|E|A|J|H|K|L|N|S|TZD|\\W)+", DateUtils.SHORT_DATE_MASK + ' ' + DateUtils.SHORT_TIME_MASK );
}
/**
* Formats a time into a certain time format
*
* @param date The date to format
* @param mask How the date should be formatted
*
* @return A formatted time
*/
public static function timeFormat( date:Date, mask:String=DateUtils.SHORT_TIME_MASK ):String {
return buildDateTime( date, mask, "(A|:|J|H|K|L|N|S|TZD|\\s)+", DateUtils.SHORT_TIME_MASK );
}
/**
* Formats a date into a certain date format
*
* @param date The date to format
* @param mask How the date should be formatted
*
* @return A formatted date
*/
public static function dateFormat( date:Date, mask:String=DateUtils.SHORT_DATE_MASK ):String {
return buildDateTime( date, mask, "(Y|M|D|E|\\W)+", DateUtils.SHORT_DATE_MASK );
}
/**
* @private
*
* Formats a date into a certain date/time format
*
* @param date The date to format
* @param mask The string for matching
* @param pattern The valid characters for this mask
* @param defaultValue The default value to return to the calling page should the mask not match the pattern
*
* @return A formatted date
*/
private static function buildDateTime( date:Date, mask:String, pattern:String, defaultValue:String ):String {
dateFormatter.formatString = removeInvalidDateTimeCharacters( mask, pattern, defaultValue );
return dateFormatter.format( date ).replace( new RegExp( "TZD", "i" ), buildTimeZoneDesignation( date ) );
}
/**
* @private
*
* Calculates a timeZoneOffset, and converts it to a string, in standard GMT XX:XX format
*
* @param date The date on which to calculate the offset
*
* @return The formatted time zone designation
*/
private static function buildTimeZoneDesignation( date:Date ):String {
if ( !date ) {
return "";
}
var timeZoneAsString:String = "GMT ";
// timezoneoffset is the number that needs to be added to the local time to get to GMT, so
// a positive number would actually be GMT -X hours
if ( date.getTimezoneOffset() / 60 > 0 && date.getTimezoneOffset() / 60 < 10 ) {
timeZoneAsString += "-0" + ( date.getTimezoneOffset() / 60 ).toString();
} else if ( date.getTimezoneOffset() < 0 && date.timezoneOffset / 60 > -10 ) {
timeZoneAsString += "0" + ( -1 * date.getTimezoneOffset() / 60 ).toString();
}
// add zeros to match standard format
timeZoneAsString += "00";
return timeZoneAsString;
}
/**
* Adds the specified number of "date parts" to a date, e.g. 6 days
*
* @param datePart The part of the date that will be added
* @param number The total number of "dateParts" to add to the date
* @param date The date on which to add
*
* @return The new date
*/
public static function dateAdd( datePart:String, number:Number, date:Date ):Date {
var _returnDate:Date = new Date( date );
switch ( datePart ) {
case DateUtils.YEAR:
case DateUtils.MONTH:
case DateUtils.DAY_OF_MONTH:
case DateUtils.HOURS:
case DateUtils.MINUTES:
case DateUtils.SECONDS:
case DateUtils.MILLISECONDS:
_returnDate[ datePart ] += number;
break;
case DateUtils.WEEK:
_returnDate[ DateUtils.DAY_OF_MONTH ] += number * 7;
break;
default:
/* Unknown date part, do nothing. */
break;
}
return _returnDate;
}
/**
* Gets the day of the week
*
* @param date The date for which to get the day of the week
*
* @return A number representing the day of the week, 0 to 6
*/
public static function dayOfWeek( date:Date ):Number {
return date.getDay();
}
/**
* Gets the ordinal value or day of the year
*
* @param date The date for which to get the day of the year
*
* @return A number representing the day of the year, 1 to 365 or 366 for a leap year
*/
public static function dayOfYear( date:Date ):Number {
// add one as it has to include first of year
return DateUtils.dateDiff( DateUtils.DAY_OF_MONTH, new Date( date.fullYear, DateUtils.monthAsNumber( DateUtils.JANUARY ), 1 ), date ) + 1;
}
/**
* Gets the week of the year
*
* @param date The date for which to get the week of the year
*
* @return A number representing the week of the year, 1 to 53 ( as there are slightly more than 52 weeks of days in a year)
*/
public static function weekOfYear( date:Date ):Number {
return Math.ceil( DateUtils.dayOfYear( date ) / 7 );
}
/**
* Converts the day of the week to a Flex day of the week
*
* @param date The human readable day of week
*
* @return The Flex converted day of week or 0 aka Sunday
*/
public static function toFlexDayOfWeek( localDayOfWeek:Number ):Number {
return ( localDayOfWeek > 0 && localDayOfWeek < 8 ) ? localDayOfWeek - 1 : 0;
}
/**
* Gets the Xth day of the month.
* e.g. get the 3rd Wednesday of the month
*
* @param iteration The iteration of the month to get e.g. 4th or Last
* @param strDayOfWeek The day of the week as a string
* @param date The date containing the month and year
*
* @return The date of the xth dayOfWeek of the month
*/
public static function dayOfWeekIterationOfMonth( iteration:Number, strDayOfWeek:String, date:Date ):Date {
// get the numeric day of the week for the requested day
var _dayOfWeek:Number = dayOfWeekAsNumber( strDayOfWeek );
// get the date for the first of the month
var _firstOfMonth:Date = new Date( date.fullYear, date.month, 1 );
// calculate how many days to add to get to the requested day from the first of the month
var _daysToAdd:Number = _dayOfWeek - DateUtils.dayOfWeek( _firstOfMonth );
// if dayOfWeek is before the first of the month, get the dayOfWeek for the following week
if ( _daysToAdd < 0 ) {
_daysToAdd += 7;
}
// set the date to the first day of the week for the requested date
var _firstDayOfWeekOfMonth:Date = DateUtils.dateAdd( DateUtils.DAY_OF_MONTH, _daysToAdd, _firstOfMonth );
// return the date if iteration is 1
if ( iteration == 1 ) {
return _firstDayOfWeekOfMonth;
} else {
// if requesting an iteration that is more than is in that month or requesting the last day of week of month
// return last date for that day of week of month
if ( ( DateUtils.totalDayOfWeekInMonth( strDayOfWeek, date ) < iteration ) || ( iteration == DateUtils.LAST ) ) {
iteration = DateUtils.totalDayOfWeekInMonth( strDayOfWeek, date );
}
// subtract 1 as it starts from the first dayOfWeek of month
return DateUtils.dateAdd( DateUtils.WEEK, iteration - 1, _firstDayOfWeekOfMonth );
}
}
/**
* Gets the days in the month
*
* @param date The date to check
*
* @return The number of days in the month
*/
public static function daysInMonth( date:Date ):Number {
// get the first day of the next month
var _localDate:Date = new Date( date.fullYear, DateUtils.dateAdd( DateUtils.MONTH, 1, date ).month, 1 );
// subtract 1 day to get the last day of the requested month
return DateUtils.dateAdd( DateUtils.DAY_OF_MONTH, -1, _localDate ).date;
}
/**
* Gets the total number of dayOfWeek in the month
*
* @param strDayOfWeek The day of week to check
* @param date The date containing the month and year
*
* @return The number of <code>strDayOfWeek</code> in that month and year
*/
public static function totalDayOfWeekInMonth( strDayOfWeek:String, date:Date ):Number {
var _startDate:Date = DateUtils.dayOfWeekIterationOfMonth( 1, strDayOfWeek, date );
var _totalDays:Number = DateUtils.dateDiff( DateUtils.DAY_OF_MONTH, _startDate, new Date( date.fullYear, date.month, DateUtils.daysInMonth( date ) ) );
// have to add 1 because have to include first day that is found i.e. if wed is on 2nd of 31 day month, would total 5, of if wed on 6th, would total 4
return Math.floor( _totalDays / 7 ) + 1;
}
/**
* Converts the month to a Flex month
*
* @param date The human readable month
*
* @return The Flex converted month or 0 aka January
*/
public static function toFlexMonth( localMonth:Number ):Number {
return ( localMonth > 0 && localMonth < 13 ) ? localMonth - 1 : 0;
}
/**
* Determines whether a value is actually a valid date
*
* @param value The date value
*
* @return <code>true</code> means this is a valid date, <code>false</code> means it is not a valid date
*/
public static function isDate( value:String ):Boolean {
return Date.parse( value ) > 0;
}
/**
* Formats a date to the string version of the day of the week
*
* @param date The date to format
*
* @return A formatted day of week
*/
public static function dayOfWeekAsString( date:Date ):String {
return DateUtils.dateFormat( date, "EEEE" );
}
/**
* Formats a date to the numeric version of the day of the week
*
* @param strDayOfWeek The day of week to convert
*
* @return A formatted day of week or -1 if day not found
*/
public static function dayOfWeekAsNumber( strDayOfWeek:String ):Number {
return ( objDaysOfWeek[ strDayOfWeek ] >= 0 ) ? objDaysOfWeek[ strDayOfWeek ] : -1;
}
/**
* Formats a date to the string version of the month
*
* @param date The date to format
*
* @return A formatted month
*/
public static function monthAsString( date:Date ):String {
return DateUtils.dateFormat( date, "MMMM" );
}
/**
* Formats a month to the numeric version of the month
*
* @param strMonth The month to convert
*
* @return A formatted month or -1 if month not found
*/
public static function monthAsNumber( strMonth:String ):Number {
return ( objMonth[ strMonth ] >= 0 ) ? objMonth[ strMonth ] : -1;
}
/**
* Gets the number of days in the year
*
* @param date The date to check
*
* @return The total number of days in the year
*/
public static function daysInYear( date:Date ):Number {
return DateUtils.dateDiff(
DateUtils.DAY_OF_MONTH,
new Date( date.fullYear, DateUtils.monthAsNumber( DateUtils.JANUARY ), 1 ),
DateUtils.dateAdd( DateUtils.YEAR, 1, new Date( date.fullYear, DateUtils.monthAsNumber( DateUtils.JANUARY ), 1 ) ) );
}
/**
* Determines whether the year is a leap year or not
*
* @param date The date to check
*
* @return <code>true</code> means it is a leap year, <code>false</code> means it is not a leap year.
*/
public static function isLeapYear( date:Date ):Boolean {
return daysInYear( date ) > 365;
}
/**
* Determines the number of "dateParts" difference between 2 dates
*
* @param datePart The part of the date that will be checked
* @param startDate The starting date
* @param endDate The ending date
*
* @return The number of "dateParts" difference
*/
public static function dateDiff( datePart:String, startDate:Date, endDate:Date ):Number {
var _returnValue:Number = 0;
switch ( datePart ) {
case DateUtils.MILLISECONDS:
_returnValue = endDate.time - startDate.time;
break;
case DateUtils.SECONDS:
_returnValue = Math.floor( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) / DateUtils.SECOND_VALUE );
break;
case DateUtils.MINUTES:
_returnValue = Math.floor( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) / DateUtils.MINUTE_VALUE );
break;
case DateUtils.HOURS:
_returnValue = Math.floor( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) / DateUtils.HOUR_VALUE );
break;
case DateUtils.DAY_OF_MONTH:
// TODO: Need to figure out DST problem i.e. 23 hours at DST start, 25 at end.
// Math.floor causes rounding down error with DST start at dayOfYear
_returnValue = Math.floor( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) / DateUtils.DAY_VALUE );
break;
case DateUtils.WEEK:
_returnValue = Math.floor( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) / DateUtils.WEEK_VALUE );
break;
case DateUtils.MONTH:
// if start date is after end date, switch values and take inverse of return value
if ( DateUtils.dateDiff( DateUtils.MILLISECONDS, startDate, endDate ) < 0 ) {
_returnValue -= DateUtils.dateDiff( DateUtils.MONTH, endDate, startDate );
} else {
// get number of months based upon years
_returnValue = DateUtils.dateDiff( DateUtils.YEAR, startDate, endDate ) * 12;
// subtract months then perform test to verify whether to subtract one month or not
// the check below gets the correct starting number of months (but may need to have one month removed after check)
if ( endDate.month != startDate.month ) {
_returnValue += ( endDate.month <= startDate.month ) ? 12 - startDate.month + endDate.month : endDate.month - startDate.month;
}
// have to perform same checks as YEAR
// i.e. if end date day is <= start date day, and end date milliseconds < start date milliseconds
if ( ( endDate[ DateUtils.DAY_OF_MONTH ] < startDate[ DateUtils.DAY_OF_MONTH ] ) ||
( endDate[ DateUtils.DAY_OF_MONTH ] == startDate[ DateUtils.DAY_OF_MONTH ] &&
endDate[ DateUtils.MILLISECONDS ] < startDate[ DateUtils.MILLISECONDS ] ) ) {
_returnValue -= 1;
}
}
break;
case DateUtils.YEAR:
_returnValue = endDate.fullYear - startDate.fullYear;
// this fixes the previous problem with dates that ran into 2 calendar years
// previously, if 2 dates were in separate calendar years, but the months were not > 1 year apart, then it was returning too many years
// e.g. 11/2008 to 2/2009 was returning 1, but should have been returning 0 (zero)
// if start date before end date and months are less than 1 year apart, add 1 to year to fix offset issue
// if end date before start date and months are less than 1 year apart, subtract 1 year to fix offset issue
// added month and milliseconds check to make sure that a date that was e.g. 9/11/07 9:15AM would not return 1 year if the end date was 9/11/08 9:14AM
if ( _returnValue != 0 ) {
// if start date is after end date
if ( _returnValue < 0 ) {
// if end date month is >= start date month, and end date day is >= start date day, and end date milliseconds > start date milliseconds
if ( ( endDate[ DateUtils.MONTH ] > startDate[ DateUtils.MONTH ] ) ||
( endDate[ DateUtils.MONTH ] == startDate[ DateUtils.MONTH ] && endDate[ DateUtils.DAY_OF_MONTH ] > startDate[ DateUtils.DAY_OF_MONTH ] ) ||
( endDate[ DateUtils.MONTH ] == startDate[ DateUtils.MONTH ] && endDate[ DateUtils.DAY_OF_MONTH ] == startDate[ DateUtils.DAY_OF_MONTH ] &&
endDate[ DateUtils.MILLISECONDS ] > startDate[ DateUtils.MILLISECONDS ] ) ) {
_returnValue += 1;
}
} else {
// if end date month is <= start date month, and end date day is <= start date day, and end date milliseconds < start date milliseconds
if ( ( endDate[ DateUtils.MONTH ] < startDate[ DateUtils.MONTH ] ) ||
( endDate[ DateUtils.MONTH ] == startDate[ DateUtils.MONTH ] && endDate[ DateUtils.DAY_OF_MONTH ] < startDate[ DateUtils.DAY_OF_MONTH ] ) ||
( endDate[ DateUtils.MONTH ] == startDate[ DateUtils.MONTH ] && endDate[ DateUtils.DAY_OF_MONTH ] == startDate[ DateUtils.DAY_OF_MONTH ] &&
endDate[ DateUtils.MILLISECONDS ] < startDate[ DateUtils.MILLISECONDS ] ) ) {
_returnValue -= 1;
}
}
}
break;
}
return _returnValue;
}
}
}
- dateutils.rar (400.3 KB)
- 下载次数: 74
评论
帮你注明出处
发表评论
-
flex 中As3Commons的使用學習
2009-10-15 12:53 3718學習Java的人,知道java中反射的强大, ... -
flex的国家化的应用
2009-09-23 08:59 2087在项目中需要使用发送短信模板的功能的,根据主题不同,模板不同, ... -
flex的沙箱问题
2009-09-14 17:14 5446在flex与google的地图整合中发现,点击了goog ... -
Flex 常用技巧
2009-09-04 13:00 2570flex是一种异步请求的技术,如果要实现同步必须在传递函 ... -
Flex 開發Google地圖
2009-08-24 13:16 24351 .获取googe的key 2.下载google的fle ... -
查询之order by,group by和having的使用
2009-08-08 15:48 4713在项目中查询常驻酒店的中住的次数最多的前10个酒店: 代码如 ... -
objectProxy的监控对象应用
2009-08-08 13:46 2671在项目中查询根据一个字段发生实现需要特殊的功能,作出相应的动作 ... -
Flex 依赖注入
2009-08-08 13:41 2086了解依赖注入 众所周 ... -
Flex 与外部的数据通信(HTTPService,URLLoader和URLRequest)
2009-08-08 13:36 7424ActionScript 3.0中提供的数据加载请求类主要是H ... -
flex 数据绑定
2009-08-08 13:31 23999.2.1 函数和类级别的绑定 [Bindable]标签打使 ... -
Flex中Entity对象与Display对象之间的数据双向动态绑定
2009-08-08 13:27 2439flex项目中对象的和组 ... -
学习ActionScript 3.0的新特点
2009-08-06 13:05 1998ActionScript3.0 是一种类型 ... -
理解 Flex itemRenderer - 第 1 部分: 内联渲染器
2009-08-05 16:37 3130Flex 提供许多控制, 它们可以按不同方式显示大量数据。Li ... -
flex 中类似Google的提示下拉菜单实现
2009-08-01 16:28 5408项目中使用类似Gooogle输入提示菜单的实现如下 ... -
针对Flex中组件的扩展的应用开发
2009-08-01 16:04 2861在项目中使用一个自定义的CheckboxGroup组件继承自C ... -
Flex类似Google搜索提示的两种做法思路
2009-08-01 15:52 2674做了个简单的搜索提示 ... -
Flex中直接获取某个组件的对象
2009-08-01 15:47 2446Flex中直接获取某个组件的对象方案1: 遍历这些butto ... -
flex 查看类的各种数据的权限
2009-08-01 15:18 1860查看类的一些属性的信息:可读,可写,可读可写。 ... -
flex中getDefinitionByName 函数的使用
2009-08-01 12:40 6731在项目中自定义一个CheckboxGroup,这个控件里面 ... -
Flex 学习中数据类型必须注意的几点
2009-08-01 12:36 2233在字符串转换为int类型必须使用 最好如下: var a:i ...
相关推荐
在Java编程语言中,时间工具类是用于处理日期和时间操作的重要工具,它们极大地简化了开发者对日期和时间的操作。本篇文章将详细讲解基于提供的"时间工具类 DateUtils"的知识点,包括DateUtils的主要功能、如何使用...
java中常用的时间操作;如日期,时间戳,日历,字符串相互转化;时间差等常用日期功能。
DateUtils工具类可以在各种Java应用程序中使用,例如在Web开发中可以使用DateUtils工具类来处理日期相关的操作,在桌面应用程序中可以使用DateUtils工具类来处理日期相关的计算等。 五、结论 DateUtils工具类是一...
1. **DateUtils**: `java.util.Date` 和 `java.time` 包含日期和时间的操作,但DateUtils通常是Apache Commons Lang库中的一个工具类,提供更方便的日期处理方法,如格式化、解析、比较和日期的加减操作。...
DateUtils.java工具类很实用
DateUtils 是一个 Java 日期工具类,提供了日期相关的常用方法和变量,方便在项目开发中使用。该类提供了多种日期格式化方式,包括年月日、时分秒、年月日时分等,并提供了字符串转换为日期、日期比较等方法。 常用...
* 根据日历的规则,为基准时间添加指定日历字段的单个时间单元 * * @param field * 日历字段, 使用Calendar类定义的日历字段常量 * @param up * 指定日历字段的值的滚动方向。true:向上滚动 / false:向...
在Java编程中,DateUtils工具类是一个非常实用的辅助类,它封装了各种日期和时间处理的方法,大大简化了开发者在处理日期时的工作。这里我们深入探讨一下自定义的DateUtils工具类及其重要功能。 首先,`DateUtils`...
非常好用的Date工具类 1、计算两个日期之间相差的天数 2、判断日期是否为周六日 3、获取当前周开始日期 4、获取当前周结束日期 5、判断年份是否是闰年 6、根据年份和月份计算天数 7、判断日期为该年的第几周 等等
在Java编程语言中,日期和时间的处理是一个常见的任务,而`DateUtils`类通常是为了简化这类操作而自定义的工具类。这个`DateUtils.zip`压缩包包含了一个名为`Time的帮助类DateUtils.txt`的文件,我们可以从中学习到...
Java 中 DateUtils 时间工具类详解 DateUtils 是一个非常实用的时间工具类,在 Java 开发中经常被使用。下面我们将详细介绍 DateUtils 时间工具类的使用方法和实现原理。 首先,DateUtils 时间工具类提供了多种...
该工具类可以在 Java 项目中使用,例如,在处理日期和时间的转换时,可以使用该工具类提供的方法来实现。例如,要将一个字符串转换为 Date 对象,可以使用 `stringToDate` 方法,要将一个 Date 对象转换为字符串,...
Java工具类DateUtils实例是Java编程语言中一个非常实用的工具类,主要用于处理日期和时间相关的操作。本文将对Java工具类DateUtils实例进行详细的解释,包括其主要方法和使用场景。 DateUtils类是Java中的一个工具...
* 文件名:DateUtils.java 日期处理相关工具类 * 版本信息:V1.0 * 日期:2013-03-11 * Copyright BDVCD Corporation 2013 * 版权所有 http://www.bdvcd.com */ public class DateUtils { /**定义常量**/ ...
一些日期的处理,获取当前时间、date日期和字符串相互转化等
在你提到的"JAVA 工具类 项目"中,很可能包含了一系列常见的工具类,如FileUtils和DateUtils,这些都是Java开发中非常实用的部分。 1. **FileUtils**: 这个工具类主要处理与文件和目录相关的操作。它可能提供了如...
在Java开发中,工具类可以涵盖许多领域,如字符串处理、日期时间操作、数学计算、集合操作等。例如,"CommonsUtils"很可能是一个类似于Apache Commons Lang或者Google Guava的库,提供了大量的实用工具方法。 1. **...
基于java环境的时间格式转化工具类
DateUtils(日期工具类),包含日期格式化,解析等。