LLMS_Date::db_date( [date] $date, [type] $type = '' )

Converts date to yyyymmdd Converts any type of date format Optional field type accepts ‘au’ to convert Australian dd/mm/yyyy date format Used for date db storage


Parameters Parameters

$date

([date]) (Required) [datestring]

$type

([type]) (Optional) [optional field for managing AU date conversions]

Default value: ''


Top ↑

Return Return

([date]) [datestring]


Top ↑

Source Source

File: includes/class.llms.date.php

	public static function db_date( $date, $type = '' ) {

		if ( 'au' === $type ) {
			list($d, $m, $y) = preg_split( '/\//', $date );
			$date            = sprintf( '%4d-%02d-%02d', $y, $m, $d );
		} else {
			$date = date( 'Y-m-d', strtotime( $date ) );
		}

		return $date;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.