Flex: 将Date输出为YYYYMMDDHHMMSS格式

Categories: Flex; Tagged with: ; @ January 15th, 2010 21:34
	/** 将给定的Date输出为YYYYMMDDHHMMSS格式, 如:20100115091809., */
	public static function dateToString(date:Date):String {
		if(date == null) {
			return null;
		}else{
			return date.fullYear.toString() + (date.month + 1 < 10 ? "0" : "") + (date.month + 1) +
				(date.date < 10 ? "0" : "") + date.date + (date.hours < 10 ? "0" : "") + date.hours +
				(date.minutes < 10 ? "0" : "") + date.minutes + (date.seconds < 10 ? "0" : "") + date.seconds;
		}
	}

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.