diff --git a/inc/always.php b/inc/always.php index c06046af..221e5b21 100644 --- a/inc/always.php +++ b/inc/always.php @@ -257,3 +257,12 @@ function ConstructURL( $partial_path ) { return $url; } + +/** +* Convert a date from ISO format into the sad old HTTP format. +* @param string $isodate The date to convert +*/ +function ISODateToHTTPDate( $isodate ) { + // Use strtotime since strptime is not available on Windows platform. + return( gmstrftime('%a, %d %b %Y %T GMT', strtotime($isodate)) ); +} diff --git a/inc/always.php.in b/inc/always.php.in index d490dd82..e897402b 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -257,3 +257,12 @@ function ConstructURL( $partial_path ) { return $url; } + +/** +* Convert a date from ISO format into the sad old HTTP format. +* @param string $isodate The date to convert +*/ +function ISODateToHTTPDate( $isodate ) { + // Use strtotime since strptime is not available on Windows platform. + return( gmstrftime('%a, %d %b %Y %T GMT', strtotime($isodate)) ); +}