Checks to see if a date stamp is ISO-8601 formatted, and if not, makes it so.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
A date stamp, or a string that can be parsed into a date stamp. |
Returns
Type |
Description |
---|---|
An ISO-8601 formatted date stamp. |
Examples
Convert a date into ISO-8601 format.
// Instantiate the object $s3 = new AmazonS3(); // Test for ISO-8601, and convert if not. $date_correct = '2009-08-01T07:00:00Z'; $date_incorrect = '1 August 2009, 7am GMT'; // Success? var_dump($s3->util->convert_date_to_iso8601($date_correct)); var_dump($s3->util->convert_date_to_iso8601($date_incorrect));Result:
string(20) "2009-08-01T07:00:00Z" string(20) "2009-08-01T07:00:00Z"
Source
Method defined in utilities/utilities.class.php | Toggle source view (9 lines) | View on GitHub