| @@ -5,10 +5,8 @@ | ||
| 5 | 5 | * @package Timetics |
| 6 | 6 | */ |
| 7 | 7 | namespace Timetics\Core\DummyData\Provider; |
| 8 | 8 | |
| 9 | -defined( 'ABSPATH' ) || exit; | |
| 10 | - | |
| 11 | 9 | /** |
| 12 | 10 | * Date time faker class |
| 13 | 11 | */ |
| 14 | 12 | class DateTime { |
| @@ -17,9 +15,9 @@ | ||
| 17 | 15 | * |
| 18 | 16 | * @return string |
| 19 | 17 | */ |
| 20 | 18 | public static function date( $format = 'Y-m-d' ) { |
| 21 | - return gmdate( $format, self::timestamp() ); | |
| 19 | + return date( $format, self::timestamp() ); | |
| 22 | 20 | } |
| 23 | 21 | |
| 24 | 22 | /** |
| 25 | 23 | * Get generated time |
| @@ -26,9 +24,9 @@ | ||
| 26 | 24 | * |
| 27 | 25 | * @return string |
| 28 | 26 | */ |
| 29 | 27 | public static function time( $format = 'h:i a' ) { |
| 30 | - return gmdate( $format, self::timestamp() ); | |
| 28 | + return date( $format, self::timestamp() ); | |
| 31 | 29 | } |
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | 32 | * Get generated timestamp |
| @@ -39,9 +37,9 @@ | ||
| 39 | 37 | $start_timestamp = strtotime( '1970-01-01' ); |
| 40 | 38 | $end_timestamp = strtotime( '2030-12-31' ); |
| 41 | 39 | |
| 42 | 40 | // Generate a random timestamp within the valid range |
| 43 | - $random_timestamp = wp_rand( $start_timestamp, $end_timestamp ); | |
| 41 | + $random_timestamp = mt_rand( $start_timestamp, $end_timestamp ); | |
| 44 | 42 | |
| 45 | 43 | // Format the timestamp into a valid date format |
| 46 | 44 | return $random_timestamp; |
| 47 | 45 | } |