__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Aws\Api;
/**
* Represents a timestamp shape.
*/
class TimestampShape extends Shape
{
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'timestamp';
parent::__construct($definition, $shapeMap);
}
/**
* Formats a timestamp value for a service.
*
* @param mixed $value Value to format
* @param string $format Format used to serialize the value
*
* @return int|string
* @throws \UnexpectedValueException if the format is unknown.
* @throws \InvalidArgumentException if the value is an unsupported type.
*/
public static function format($value, $format)
{
if ($value instanceof \DateTimeInterface) {
$value = $value->getTimestamp();
} elseif (is_string($value)) {
$value = strtotime($value);
} elseif (!is_int($value)) {
throw new \InvalidArgumentException('Unable to handle the provided'
. ' timestamp type: ' . gettype($value));
}
switch ($format) {
case 'iso8601':
return gmdate('Y-m-d\TH:i:s\Z', $value);
case 'rfc822':
return gmdate('D, d M Y H:i:s \G\M\T', $value);
case 'unixTimestamp':
return $value;
default:
throw new \UnexpectedValueException('Unknown timestamp format: '
. $format);
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| ErrorParser | Folder | 0777 |
|
|
| Parser | Folder | 0777 |
|
|
| Serializer | Folder | 0777 |
|
|
| AbstractModel.php | File | 1.96 KB | 0777 |
|
| ApiProvider.php | File | 7.47 KB | 0777 |
|
| DateTimeResult.php | File | 4.09 KB | 0777 |
|
| DocModel.php | File | 3.38 KB | 0777 |
|
| ListShape.php | File | 786 B | 0777 |
|
| MapShape.php | File | 1.14 KB | 0777 |
|
| Operation.php | File | 3.38 KB | 0777 |
|
| Service.php | File | 13.53 KB | 0777 |
|
| Shape.php | File | 1.81 KB | 0777 |
|
| ShapeMap.php | File | 1.46 KB | 0777 |
|
| StructureShape.php | File | 1.65 KB | 0777 |
|
| TimestampShape.php | File | 1.45 KB | 0777 |
|
| Validator.php | File | 10.04 KB | 0777 |
|