mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-20 06:09:32 +00:00
Add function for converting ISO date to HTTP date.
This commit is contained in:
parent
35a9d326ab
commit
a264cbc9b7
@ -257,3 +257,12 @@ function ConstructURL( $partial_path ) {
|
|||||||
return $url;
|
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)) );
|
||||||
|
}
|
||||||
|
|||||||
@ -257,3 +257,12 @@ function ConstructURL( $partial_path ) {
|
|||||||
return $url;
|
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)) );
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user