1--TEST--
2IntlCalendar::fromDateTime(): basic test
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7ini_set("intl.error_level", E_WARNING);
8ini_set("intl.default_locale", "nl_NL");
9date_default_timezone_set('Europe/Lisbon');
10
11$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00 Europe/Rome');
12var_dump(
13    $cal->getTime(),
14    strtotime('2012-01-01 00:00:00 Europe/Rome') * 1000.,
15    $cal->getTimeZone()->getID(),
16    $cal->getLocale(1)
17);
18echo "\n";
19
20$cal = IntlCalendar::fromDateTime(new DateTime('2012-01-01 00:00:00 PST'), "pt_PT");
21var_dump(
22    $cal->getTime(),
23    strtotime('2012-01-01 00:00:00 PST') * 1000.,
24    $cal->getTimeZone()->getID(),
25    $cal->getLocale(1)
26);
27
28echo "\n";
29
30$cal = intlcal_from_date_time(new DateTime('2012-01-01 00:00:00 +03:40'));
31var_dump(
32    $cal->getTime(),
33    strtotime('2012-01-01 00:00:00 +03:40') * 1000.,
34    $cal->getTimeZone()->getID()
35);
36?>
37--EXPECTF--
38float(1325372400000)
39float(1325372400000)
40string(11) "Europe/Rome"
41string(5) "nl_NL"
42
43float(1325404800000)
44float(1325404800000)
45string(3) "PST"
46string(5) "pt_PT"
47
48float(1325362800000)
49float(1325362800000)
50string(%d) "GMT+03%S40"
51