Mark MCRouter* as __PHPStdLib
[hiphop-php.git] / hphp / hack / hhi / stdlib / builtins_datetime.hhi
blobd5b2e2a81bc141b69b9fae15b87a5cb649d373fd
1 <?hh // decl    /* -*- php -*- */
2 /**
3  * Copyright (c) 2014, Facebook, Inc.
4  * All rights reserved.
5  *
6  * This source code is licensed under the MIT license found in the
7  * LICENSE file in the "hack" directory of this source tree.
8  *
9  */
11 const DATE_ATOM    = "Y-m-d\\TH:i:sP";
12 const DATE_COOKIE  = "l, d-M-y H:i:s T";
13 const DATE_ISO8601 = "Y-m-d\\TH:i:sO";
14 const DATE_RFC1036 = "D, d M y H:i:s O";
15 const DATE_RFC1123 = "D, d M Y H:i:s O";
16 const DATE_RFC2822 = "D, d M Y H:i:s O";
17 const DATE_RFC3339 = "Y-m-d\\TH:i:sP";
18 const DATE_RFC822  = "D, d M y H:i:s O";
19 const DATE_RFC850  = "l, d-M-y H:i:s T";
20 const DATE_RSS     = "D, d M Y H:i:s O";
21 const DATE_W3C     = "Y-m-d\\TH:i:sP";
23 const DAY_1 = 131079;
24 const DAY_2 = 131080;
25 const DAY_3 = 131081;
26 const DAY_4 = 131082;
27 const DAY_5 = 131083;
28 const DAY_6 = 131084;
29 const DAY_7 = 131085;
31 <<__PHPStdLib>>
32 function checkdate($month, $day, $year) { }
33 <<__PHPStdLib>>
34 function date_add($datetime, $interval) { }
35 <<__PHPStdLib>>
36 function date_create_from_format($format, $time, $timezone = null) { }
37 <<__PHPStdLib>>
38 function date_create($time = null, $timezone = null) { }
39 <<__PHPStdLib>>
40 function date_date_set($object, $year, $month, $day) { }
41 <<__PHPStdLib>>
42 function date_default_timezone_get() { }
43 <<__PHPStdLib>>
44 function date_default_timezone_set($name) { }
45 <<__PHPStdLib>>
46 function date_diff($datetime, $datetime2, $absolute = false) { }
47 <<__PHPStdLib>>
48 function date_format($object, $format) { }
49 <<__PHPStdLib>>
50 function date_get_last_errors() { }
51 <<__PHPStdLib>>
52 function date_interval_create_from_date_string($time) { }
53 <<__PHPStdLib>>
54 function date_interval_format($interval, $format_spec) { }
55 <<__PHPStdLib>>
56 function date_isodate_set($object, $year, $week, $day = 1) { }
57 <<__PHPStdLib>>
58 function date_modify($object, $modify) { }
59 <<__PHPStdLib>>
60 function date_offset_get($object) { }
61 <<__PHPStdLib>>
62 function date_parse($date) { }
63 <<__PHPStdLib>>
64 function date_sub($datetime, $interval) { }
65 <<__PHPStdLib>>
66 function date_sun_info($ts, $latitude, $longitude) { }
67 <<__PHPStdLib>>
68 function date_sunrise($timestamp, $format = 0, $latitude = 0.0, $longitude = 0.0, $zenith = 0.0, $gmt_offset = 99999.0) { }
69 <<__PHPStdLib>>
70 function date_sunset($timestamp, $format = 0, $latitude = 0.0, $longitude = 0.0, $zenith = 0.0, $gmt_offset = 99999.0) { }
71 <<__PHPStdLib>>
72 function date_time_set($object, $hour, $minute, $second = 0) { }
73 <<__PHPStdLib>>
74 function date_timestamp_get($datetime) { }
75 <<__PHPStdLib>>
76 function date_timestamp_set($datetime, $timestamp) { }
77 <<__PHPStdLib>>
78 function date_timezone_get($object) { }
79 <<__PHPStdLib>>
80 function date_timezone_set($object, $timezone) { }
81 <<__PHPStdLib>>
82 function date($format, $timestamp = null)/*: string*/ { }
83 <<__PHPStdLib>>
84 function getdate($timestamp = null) { }
85 <<__PHPStdLib>>
86 function gettimeofday($return_float = false) { }
87 <<__PHPStdLib>>
88 function gmdate($format, $timestamp = null) { }
89 <<__PHPStdLib>>
90 function gmmktime($hour = PHP_INT_MAX, $minute = PHP_INT_MAX, $second = PHP_INT_MAX, $month = PHP_INT_MAX, $day = PHP_INT_MAX, $year = PHP_INT_MAX) { }
91 <<__PHPStdLib>>
92 function gmstrftime($format, $timestamp = null) { }
93 <<__PHPStdLib>>
94 function idate($format, $timestamp = null) { }
95 <<__PHPStdLib>>
96 function localtime($timestamp = null, $is_associative = false) { }
97 <<__PHPStdLib>>
98 function microtime($get_as_float = false) { }
99 <<__PHPStdLib>>
100 function mktime($hour = PHP_INT_MAX, $minute = PHP_INT_MAX, $second = PHP_INT_MAX, $month = PHP_INT_MAX, $day = PHP_INT_MAX, $year = PHP_INT_MAX) { }
101 <<__PHPStdLib>>
102 function strftime($format, $timestamp = null) { }
103 <<__PHPStdLib>>
104 function strptime($date, $format) { }
105 <<__PHPStdLib>>
106 function strtotime($input, $timestamp = null) { }
107 <<__PHPStdLib>>
108 function time(): int { }
109 <<__PHPStdLib>>
110 function timezone_abbreviations_list() { }
111 <<__PHPStdLib>>
112 function timezone_identifiers_list(int $what = 2047, string $country = '') { }
113 <<__PHPStdLib>>
114 function timezone_location_get($timezone) { }
115 <<__PHPStdLib>>
116 function timezone_name_from_abbr($abbr, $gmtoffset = -1, $isdst = true) { }
117 <<__PHPStdLib>>
118 function timezone_name_get($object) { }
119 <<__PHPStdLib>>
120 function timezone_offset_get($object, $dt) { }
121 <<__PHPStdLib>>
122 function timezone_open($timezone) { }
123 <<__PHPStdLib>>
124 function timezone_transitions_get(DateTimeZone $object,
125                                   int $timestamp_begin = PHP_INT_MIN,
126                                   int $timestamp_end = PHP_INT_MAX) { }
127 <<__PHPStdLib>>
128 function timezone_version_get() { }
130 interface DateTimeInterface {
131   public function diff(DateTimeInterface $datetime2, bool $absolute = false);
132   public function format(string $format);
133   public function getOffset();
134   public function getTimestamp();
135   public function getTimezone();
138 class DateTime implements DateTimeInterface {
139   const ATOM = '';
140   const COOKIE = '';
141   const ISO8601 = '';
142   const RFC822 = '';
143   const RFC850 = '';
144   const RFC1036 = '';
145   const RFC1123 = '';
146   const RFC2822 = '';
147   const RFC3339 = '';
148   const RSS = '';
149   const W3C = '';
150   public function __construct(mixed $time = 'now', ?DateTimeZone $timezone = null);
151   public function add(DateInterval $interval);
152   public function modify(string $modify);
153   public function getOffset();
154   public function getTimestamp();
155   public function getTimezone();
156   public function setDate(int $year, int $month, int $day);
157   public function setISODate(int $year, int $week, int $day = 1);
158   public function setTime(int $hour, int $minute, int $second = 0);
159   public function setTimestamp(int $unixtimestamp);
160   public function setTimezone(DateTimeZone $timezone);
161   public function sub(DateInterval $interval) { }
162   public function diff(DateTimeInterface $datetime2, bool $absolute = false);
163   public function format(string $format);
164   public static function createFromFormat(
165     string $format,
166     mixed $time,
167     ?DateTimeZone $timezone = null,
168   );
169   public static function getLastErrors(): array;
172 class DateTimeImmutable implements DateTimeInterface {
173   private DateTime $data;
175   public function __construct(mixed $time = 'now', ?DateTimeZone $timezone = null);
176   public function add(DateInterval $interval);
177   public function modify(string $modify);
178   public function getOffset();
179   public function getTimestamp();
180   public function getTimezone();
181   public function setDate(int $year, int $month, int $day);
182   public function setISODate(int $year, int $week, int $day = 1);
183   public function setTime(int $hour, int $minute, int $second = 0);
184   public function setTimestamp(int $unixtimestamp);
185   public function setTimezone(DateTimeZone $timezone);
186   public function sub(DateInterval $interval);
187   public function diff(DateTimeInterface $datetime2, bool $absolute = false);
188   public function format(string $format);
189   public static function createFromFormat(
190     string $format,
191     mixed $time,
192     ?DateTimeZone $timezone = null,
193   );
194   public static function createFromMutable(DateTime $datetime);
195   public static function getLastErrors(): array;
196   public function __clone();
199 class DateTimeZone {
200   const AFRICA = 0;
201   const AMERICA = 0;
202   const ANTARCTICA = 0;
203   const ARCTIC = 0;
204   const ASIA = 0;
205   const ATLANTIC = 0;
206   const AUSTRALIA = 0;
207   const EUROPE = 0;
208   const INDIAN = 0;
209   const PACIFIC = 0;
210   const UTC = 0;
211   const ALL = 0;
212   const ALL_WITH_BC = 0;
213   const PER_COUNTRY = 0;
214   public function __construct(string $timezone);
215   public function getLocation(): array { }
216   public function getName(): string { }
217   public function getOffset(DateTime $datetime);
218   public function getTransitions(int $timestamp_begin = PHP_INT_MIN,
219                                  int $timestamp_end = PHP_INT_MAX);
220   static public function listAbbreviations();
221   static public function listIdentifiers(int $what = 2047, string $country = '');
224 class DateInterval {
225   public int $y;
226   public int $m;
227   public int $d;
228   public int $h;
229   public int $i;
230   public int $s;
231   public int $invert;
232   public mixed $days;
234   public function __construct(string $interval_spec);
235   public function __get($member);
236   public function __set($member, $value);
237   static public function createFromDateString(string $time);
238   public function format(string $format);
241 class DatePeriod implements Iterator<DateTime> {
242   const EXCLUDE_START_DATE = 1;
244   public function __construct(
245     /* DateTimeInterface */ $start, // date string converts
246     DateInterval $interval,
247     /* ?DateTimeInterface */ $end = null, // date string converts
248     int $options = 0,
249   );
250   public function current(): DateTime;
251   public function rewind(): void;
252   public function key();
253   public function next();
254   public function valid(): bool;
255   public function getStartDate(): DateTime;
256   public function getEndDate(): DateTime;
257   public function getDateInterval(): DateInterval;