12345678910111213141516171819202122232425262728 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/4/22
- * Time: 上午11:50
- */
- namespace app\main\helper;
- class DateHelper
- {
- public static function ios_8601()
- {
- $current = microtime(true);
- $micro = '';
- if (strstr($current, '.')) {
- list(, $micro) = explode('.', microtime(true));
- }
- if (strlen($micro) > 3) {
- $micro = substr($micro, 0, 3);
- } else {
- $micro = str_pad($micro, 3, '0');
- }
- return sprintf("%s.%sZ", date('Y-m-d\TH:i:s'), $micro);
- }
- }
|