
	/*
	Trimming function to get rid of leading and trailing spaces....
	Trims spaces only.
	*/
	function str_trim(str) 
	{
		str = str.toString();
		while (1) 
		{
			if (str.substring(0, 1) != " ")
			{
				break;
			}
			str = str.substring(1, str.length);
		}
		while (1) 
		{
			if( (str.substring(str.length - 1,str.length) != " ") )
			{
				break;
			}
			str = str.substring(0, str.length - 1);
		}
		return str;
	}	

	/*************************************************************** 
	*	class: 		MMDate
	*
	*	purpose:	used to convert between date formats such
	*				as UTC --> US date
	*	
	*	author:		c stevenson
	*
	*	date:		2003-10-20
	***************************************************************/
	/*
	* class constructor
	*accepts date and format of date coming in
	* valid formats are (case sensitive)
	*
	*
	date formats							explanation
	dd-mm-yyyy
	dd-mm-yyyy hh:MM:ss
	dd-mm-yyyy hh:MM
	dd/mm/yyyy
	dd/mm/yyyy hh:MM:ss
	dd/mm/yyyy hh:MM
	dd.mm.yyyy
	mm/dd/yyyy 
	mm/dd/yyyy hh:MM:ss
	mm/dd/yyyy hh:MM
	mm.dd.yyyy
	mm-dd-yyyy
	mm-dd-yyyy hh:MM:ss
	yyyy-mm-ddThh:MM:ssTZD			this is the standard UTC format with offset			ex 2003-10-01T12:53:01-05:00
	yyyy-mm-ddThh:MM:ss			this is the sql server UTC format non-standard (thanks bill)	ex 2003-10-01T17:53:01	
	yyyy-mm-ddThh:MM:ssZ			this is the standard UTC format  without offset (ie gmt)	ex 2003-10-01T17:53:01Z
	yyyy-mm-ddThh:MM:ss* 			this is a firkle as sometimes sql server returns utc dates as	
						2003-10-01T17:53:01	and sometimes as ex 2003-10-01T17:53:01.000
						so am just defining this format as a catch all (thanks bill)	
	
	*/
function MMDate( sDate, sFormat )
{
	
	
	//declare member variables
	this.unSetVariable;
	this.date = str_trim(sDate);
	this.format = sFormat;
	this.formatArray = null;
	this.dateArray = null;
	this.isUTCFlag = false;
	this.offsetInHours = 0;
	this.oDate = null;
	this.delimiter	= '/';
	this.timezoneOffset = 0;
	
	//declare member methods 	
	this.toUTCDate 						= toUTCDate;
	this.toUSDate 						= toUSDate;
	this.toUKDate 						= toUKDate;
	this.toUKDateMonthAsString 				= toUKDateMonthAsString;
	this.toSQLUTCDate					= toSQLUTCDate;
	this.makeDateObject					= makeDateObject;
	this.toUKDateTime					= toUKDateTime;
	this.toUSDateTime					= toUSDateTime;
	this.toSQLUpperLimitUTCDate				= toSQLUpperLimitUTCDate;
	this.toSQLLowerLimitUTCDate				= toSQLLowerLimitUTCDate;
	this.setHoursToUpperLimit				= setHoursToUpperLimit;
	this.setHoursToLowerLimit				= setHoursToLowerLimit;
	this.isValid						= isValid;
    this.setXMonths                     = setXMonths;
	//get-ters
	this.getSeconds 					= getSeconds;
	this.getMinutes 					= getMinutes;
	this.getHours 						= getHours;
	this.getDay 						= getDay;
	this.getMonth 						= getMonth;
	this.getMonthAsString 					= getMonthAsString;
	this.getYear 						= getYear;
	this.getGMTOffset					= getGMTOffset;
	this.getDateRegularExpression				= getDateRegularExpression;
	this.getDateFormatRegularExpression 			= getDateFormatRegularExpression;
	this.getDateObject 					= getDateObject;
	this.getDateAsFormat				= getDateAsFormat;
	
	//set-ters
	this.setDelimiter					= setDelimiter;
	this.setGMTOffset					= setGMTOffset;
	this.setToNow						= setToNow;
    
	//drop out if no format supplied
	if( this.format == '' ) return null;
	
	if( this.format == this.unSetVariable || this.date == '' || this.date == this.unSetVariable )
	{
		//alert( 'MM Date Class :: MM Date object has been instantiated incorrectly. Some parameters are null.\nformat:' + this.format + '\ndate:' + this.date );
		return null;
	}
	
	var formatPattern = null;
	var datePattern = null;
	
	//get correct regular expression for format passed
	formatPattern 	= this.getDateFormatRegularExpression( this.format  );
	datePattern 	= this.getDateRegularExpression( this.format  );
		
	this.formatArray = this.format.match( formatPattern );
	this.dateArray = this.date.match( datePattern );
	
	if( this.formatArray == this.unSetVariable || this.formatArray == null || this.dateArray == this.unSetVariable || this.dateArray == null )
	{
		//alert( 'MM Date Class :: date was not correctly parsed. Format not recongnised.\nDate:' + sDate + '\nFormat:' + sFormat + '\n\nDebug:\nFormat pattern:' + formatPattern + '\nDate pattern:' + datePattern );
		this.oDate = null;
		return null;
	}
	
	
	this.makeDateObject();
	
}

function makeDateObject()
{
	this.oDate = new Date();

	this.oDate.setFullYear( this.getYear() );
	this.oDate.setMonth( this.getMonth() -1 );
	this.oDate.setDate( this.getDay() );
	this.oDate.setHours( this.getHours() );
	this.oDate.setMinutes( this.getMinutes() );
	this.oDate.setSeconds( this.getSeconds()  );
	
}

function setToNow()
{
	this.oDate = new Date();
}

function setXMonths(iMonthDifference)
{
    this.oDate.setMonth( this.oDate.getMonth() + iMonthDifference);
}


function isValid()
{
	
	var year = this.getYear(); 

    //oldest person on the planet turned 115 in 2005...
	if (year < 1890 || year > 2100)	return false;
	
	var month = this.getMonth();
	
	if( month < 1 || month > 12 ) 	return false;
	
	var day = this.getDay();
	
	if ( day > 31 ) return false;
	if ((month == 4 || month == 6 || month==9 || month == 11) && day == 31) return false;
	
	if (month == 2) 
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
	
		if (day > 29 || (day == 29 && !isleap)) return false;
	}
		
	return true;
}

function setGMTOffset( offset )
{
	this.timezoneOffset = offset;
	this.oDate.setHours( this.oDate.getHours() + this.timezoneOffset );
}

function getDateObject()
{
	return this.oDate;
}

function setDelimiter( delim )
{
	this.delimiter = delim;
}


function getDateRegularExpression( format, date )
{
	switch( format )
	{
	case 'dd-mm-yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/;
		break;
	case 'dd-mm-yyyy hh:MM:ss' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})(:)(\d{2})$/;
		break;
	case 'dd-mm-yyyy hh:MM' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})$/;
		break;
	case 'dd/mm/yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{4})$/;
		//return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/; //this supports 2 digit years... not what we want
		break;
	case 'dd/mm/yyyy hh:MM:ss' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{4})(\s)(\d{2})(:)(\d{2})(:)(\d{2})$/;
		break;
	case 'dd/mm/yyyy hh:MM' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{4})(\s)(\d{2})(:)(\d{2})$/;
		break;
	case 'dd.mm.yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/;
		break;
	case 'mm/dd/yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{4})$/;
		//return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/; //this supports 2 digit years... not what we want
		break;
	case 'mm/dd/yyyy hh:MM:ss' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})(:)(\d{2})$/;
		break;
	case 'mm/dd/yyyy hh:MM' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})$/;
		break;
	case 'mm.dd.yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/;
		break;
	case 'mm-dd-yyyy' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})$/;
		break;
	case 'mm-dd-yyyy hh:MM' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})$/;
		break;
	case 'mm-dd-yyyy hh:MM:ss' :
		return /^(\d{1,2})(\/|-|\.)(\d{1,2}|\w{3})\2(\d{2}|\d{4})(\s)(\d{2})(:)(\d{2})(:)(\d{2})$/;
		break;
	case 'yyyy-mm-ddThh:MM:ssTZD':
		return /^(\d{4})(\/|-|\.)(\d{2})\2(\d{2})(\w{1})(\d{2})(:)(\d{2})(:)(\d{2})(\+|-)(\d{2})(:)(\d{2})$/;
		break;
	case 'yyyy-mm-ddThh:MM:ssZ':
		return /^(\d{4})(\/|-|\.)(\d{2})\2(\d{2})(\w{1})(\d{2})(:)(\d{2})(:)(\d{2})(Z)$/;
		break;
	case 'yyyy-mm-ddThh:MM:ss':
		return /^(\d{4})(\/|-|\.)(\d{2})\2(\d{2})(\w{1})(\d{2})(:)(\d{2})(:)(\d{2})$/;
		break;
	case 'yyyy-mm-ddThh:MM:ss*':
		return /^(\d{4})(\/|-|\.)(\d{2})\2(\d{2})(\w{1})(\d{2})(:)(\d{2})(:)(\d{2})/;
		break;
	default:
		return 'No match found.';
	}


}

function getDateFormatRegularExpression( format )
{
	switch( format )
	{
	case 'dd-mm-yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})$/;
		break;
	case 'dd-mm-yyyy hh:MM:ss' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})(:)(\w{2})$/;
		break;
	case 'dd-mm-yyyy hh:MM' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})$/;
		break;
	case 'dd/mm/yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{4})$/;
		break;
	case 'dd/mm/yyyy hh:MM:ss' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})(:)(\w{2})$/;
		break;
	case 'dd/mm/yyyy hh:MM' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})$/;
		break;
	case 'dd.mm.yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})$/;
		break;
	case 'mm/dd/yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})$/;
		break;
	case 'mm/dd/yyyy hh:MM:ss' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})(:)(\w{2})$/;
		break;
	case 'mm/dd/yyyy hh:MM' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})$/;
		break;
	case 'mm.dd.yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})$/;
		break;
	case 'mm-dd-yyyy' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})$/;
		break;
	case 'mm-dd-yyyy hh:MM:ss' :
		return /^(\w{1,2})(\/|-|\.)(\w{1,2}|\w{3})\2(\w{2}|\w{4})(\s)(\w{2})(:)(\w{2})(:)(\w{2})$/;
		break;
	case 'yyyy-mm-ddThh:MM:ssTZD':
		return /^(\w{4})(\/|-|\.)(\w{2})\2(\w{2})(\w{1})(\w{2})(:)(\w{2})(:)(\w{2})(TZD)$/;
		break;
	case 'yyyy-mm-ddThh:MM:ss':
		return /^(\w{4})(\/|-|\.)(\w{2})\2(\w{2})(\w{1})(\w{2})(:)(\w{2})(:)(\w{2})$/;
		break;
	case 'yyyy-mm-ddThh:MM:ssZ':
		return /^(\w{4})(\/|-|\.)(\w{2})\2(\w{2})(\w{1})(\w{2})(:)(\w{2})(:)(\w{2})(Z)$/;
		break;
	case 'yyyy-mm-ddThh:MM:ss*':
		return /^(\w{4})(\/|-|\.)(\w{2})\2(\w{2})(\w{1})(\w{2})(:)(\w{2})(:)(\w{2})(\*)$/;
		break;
	default:
		return 'No match found.';
		break;
	}
	

}

function setHoursToUpperLimit()
{
	this.oDate.setHours( 23 );
	this.oDate.setMinutes( 59 );
	this.oDate.setSeconds( 59 );
}

function setHoursToLowerLimit()
{
	this.oDate.setHours( 0 );
	this.oDate.setMinutes( 0 );
	this.oDate.setSeconds( 1 );
}

function toUTCDate()
{
	return padToFourDigits( this.oDate.getFullYear() ) + '-' + padToTwoDigits( this.oDate.getMonth() +1 ) + '-' + padToTwoDigits( this.oDate.getDate() ) + 'T' + padToTwoDigits( this.oDate.getHours() ) + ':' +  padToTwoDigits( this.oDate.getMinutes() ) + ':' +  padToTwoDigits( this.oDate.getSeconds() ) + this.getGMTOffset();
}

function toSQLUTCDate()
{
	return padToFourDigits( this.oDate.getFullYear() ) + '-' + padToTwoDigits( this.oDate.getMonth() +1 ) + '-' + padToTwoDigits( this.oDate.getDate() ) + 'T' + padToTwoDigits( this.oDate.getHours() ) + ':' +  padToTwoDigits( this.oDate.getMinutes() ) + ':' +  padToTwoDigits( this.oDate.getSeconds() );
}

function toSQLUpperLimitUTCDate()
{
	return padToFourDigits( this.oDate.getFullYear() ) + '-' + padToTwoDigits( this.oDate.getMonth() +1 ) + '-' + padToTwoDigits( this.oDate.getDate() ) + 'T' + '23:59:59';
}

function toSQLLowerLimitUTCDate()
{
	return padToFourDigits( this.oDate.getFullYear() ) + '-' + padToTwoDigits( this.oDate.getMonth() +1 ) + '-' + padToTwoDigits( this.oDate.getDate() ) + 'T' + '00:00:01';
}


function toUSDate()
{
	return padToTwoDigits( this.oDate.getMonth() + 1 ) + this.delimiter + padToTwoDigits( this.oDate.getDate() ) + this.delimiter + padToFourDigits( this.oDate.getFullYear() );
}

function toUSDateTime()
{
	return padToTwoDigits( this.oDate.getMonth() + 1 ) + this.delimiter + padToTwoDigits( this.oDate.getDate() ) + this.delimiter + padToFourDigits( this.oDate.getFullYear() ) + ' ' + padToTwoDigits( this.oDate.getHours() ) + ':' +  padToTwoDigits( this.oDate.getMinutes() ) + ':' +  padToTwoDigits( this.oDate.getSeconds() );
}


function toUKDate()
{
	return padToTwoDigits( this.oDate.getDate() ) + this.delimiter + padToTwoDigits( this.oDate.getMonth() + 1 ) + this.delimiter + padToFourDigits( this.oDate.getFullYear() );
}

function toUKDateTime()
{
	return padToTwoDigits( this.oDate.getDate() ) + this.delimiter + padToTwoDigits( this.oDate.getMonth() + 1 ) + this.delimiter + padToFourDigits( this.oDate.getFullYear() ) + ' ' + padToTwoDigits( this.oDate.getHours() ) + ':' +  padToTwoDigits( this.oDate.getMinutes() ) + ':' +  padToTwoDigits( this.oDate.getSeconds() );
}


function toUKDateMonthAsString()
{
	return padToTwoDigits( this.oDate.getDate() ) + this.delimiter + this.getMonthAsString( this.oDate.getMonth() + 1 ) + this.delimiter + padToFourDigits( this.oDate.getFullYear() );
}


function getSeconds()
{
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'ss' ) return formattedParseToInt( this.dateArray[ i ] );
	}
		
	return 0;
}

function getMinutes()
{
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'MM' ) return formattedParseToInt( this.dateArray[ i ] );
	}
			
	return 0;
}

function getHours()
{
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'hh' ) return formattedParseToInt( this.dateArray[ i ] );
	}
				
	return 0;
}

function getDay()
{

	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'dd' ) 
		{
			return formattedParseToInt( this.dateArray[ i ] );
		}	
	}
	
	return 0;

}

function getMonth()
{
	//check for 2 digit month if not there check for three digit mmm
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'mm' ) return formattedParseToInt( this.dateArray[ i ] );
		else if( this.formatArray[ i ] == 'mmm' ) return getMonthAsInteger( this.dateArray[ i ] );
	}
	
	return 0;
	
}

function getGMTOffset()
{
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'z' ) return 'Z';
		else if( this.formatArray[ i ] == 'tzd' ) return this.dateArray[ i ] + '' + this.dateArray[ i + 1 ] + this.dateArray[ i + 2 ]+ this.dateArray[ i + 3 ];
	}
		
	return 'Z';
}

function getMonthAsString( monthAsInteger )
{
	switch (monthAsInteger) 
	{
	case 1 :
		return 'Jan';
		break;
	case 2 :
		return 'Feb';
		break;
	case 3 :
		return 'Mar';
		break;
	case 4 :
		return 'Apr';
		break;
	case 5 :
		return 'May';
		break;
	case 6 :
		return 'Jun';
		break;
	case 7 :
		return 'Jul';
		break;
	case 8 :
		return 'Aug';
		break;
	case 9 :
		return 'Sep';
		break;
	case 10 :
		return 'Oct';
		break;
	case 11 :
		return 'Nov';
		break;
	case 12 :
		return 'Dec';
		break;
	default : 
		return 'unknown';
	}

}

function getMonthAsInteger( monthAsString )
{
	switch ( monthAsString.toLowerCase() ) 
	{
	case 'jan' :
		return 1;
		break;
	case 'feb' :
		return 2;
		break;
	case 'mar' :
		return 3;
		break;
	case 'apr' :
		return 4;
		break;
	case 'may' :
		return 5;
		break;
	case 'jun':
		return 6;
		break;
	case 'jul' :
		return 7;
		break;
	case 'aug' :
		return 8;
		break;
	case 'sep' :
		return 9;
		break;
	case 'oct' :
		return 10;
		break;
	case 'nov' :
		return 11;
		break;
	case 'dec' :
		return 12;
		break;
	default : 
		return 'unknown';
	}

}


function padToTwoDigits( value )
{
	var strValue = new String( value );

	if( strValue.length == 2 ) return strValue ; 
	if( strValue.length == 1 ) return strValue = '0' + strValue; 
	if( strValue.length == 0 ) return strValue = '00' + strValue; 
}

function padToFourDigits( value )
{
	
	var strValue = new String( value );
	
	if( strValue.length == 4 ) return strValue; 	
	if( strValue.length == 3 ) return strValue = '0' + strValue; 
	if( strValue.length == 2 ) return strValue = '00' + strValue; 
	if( strValue.length == 1 ) return strValue = '000' + strValue; 
	if( strValue.length == 0 ) return strValue = '0000' + strValue; 
}

// this function is purely because javascript parseInt doesn't work 
// when passing in as string in this format '01'
// so am just trimming preceeding zeros before casting to integer
function formattedParseToInt( value )
{
	var newValue = value.replace( /^0{1,50}/, '' );
	
	if ( newValue == '' ) return 0;
	else return parseInt( newValue ); 
}

function getYear()
{
	var year = 0;
		
	for( var i = 0; i < this.formatArray.length; i++ )
	{
		if( this.formatArray[ i ] == 'yy' || this.formatArray[ i ] == 'yyyy' ) year = parseInt( this.dateArray[ i ] );
	}
	
	if( year >=0  && year < 67) year=2000+year;
	if( year >=67 && year <=99) year=1900+year;
	
	return year;
}

function getDateAsFormat( format )
{

	switch( format )
		{
			case 'dd-mm-yyyy' :
				this.setDelimiter( '-' );
				return this.toUKDate();
				break;
			case 'dd/mm/yyyy' :
				this.setDelimiter( '/' );
				return this.toUKDate();				
				break;
			case 'dd.mm.yyyy' :
				this.setDelimiter( '.' );
				return this.toUKDate();				
				break;			
			case 'mm/dd/yyyy' :
				this.setDelimiter( '/' );
				return this.toUSDate();				
				break;			
			case 'mm.dd.yyyy' :
				this.setDelimiter( '.' );
				return this.toUSDate();				
				break;
			case 'mm-dd-yyyy' :
				this.setDelimiter( '-' );
				return this.toUSDate();				
				break;
			case 'mm-dd-yyyy' :
				this.setDelimiter( '-' );
				return this.toUSDate();				
				break;
			case 'yyyy-mm-ddThh:MM:ssTZD':
				this.setDelimiter( '-' );
				return this.toUTCDate();				
				break;
			case 'yyyy-mm-ddThh:MM:ssZ':
				this.setDelimiter( '-' );
				return this.toUTCDate();
				break;
			case 'yyyy-mm-ddThh:MM:ss':
				this.setDelimiter( '-' );
				return this.toSQLUTCDate();
				break;
			//UL = upper limit so returns the date with time section set to 23:59:59
			case 'UL:yyyy-mm-ddThh:MM:ss':
				this.setDelimiter( '-' );
				this.setHoursToUpperLimit();
				return this.toSQLUTCDate();
				break;
			//LL = lower limit so returns the date with time section set to 00:00:01
			case 'LL:yyyy-mm-ddThh:MM:ss':
				this.setDelimiter( '-' );
				this.setHoursToLowerLimit();
				return this.toSQLUTCDate();
				break;
			default:
				return 'unrecognised format:' + format;
				break;
		}

}	
/********************* END OF CLASS DEFINITION **********************/

