xref: /PHP-8.1/ext/ftp/tests/ftp_mdtm_basic.phpt (revision e9f783fc)
1--TEST--
2Test the File Modification Time as described in http://tools.ietf.org/html/rfc3659#section-3.1
3--CREDITS--
4Nathaniel McHugh
5--EXTENSIONS--
6ftp
7pcntl
8--FILE--
9<?php
10
11require 'server.inc';
12
13$ftp = ftp_connect('127.0.0.1', $port);
14if (!$ftp) die("Couldn't connect to the server");
15
16var_dump(ftp_login($ftp, 'user', 'pass'));
17
18
19date_default_timezone_set('UTC');
20
21$time = ftp_mdtm($ftp, "A");
22echo date("F d Y H:i:s u",$time), PHP_EOL;
23
24$time = ftp_mdtm($ftp, "B");
25echo date("F d Y H:i:s u",$time), PHP_EOL;
26
27$time = ftp_mdtm($ftp, "C");
28echo date("F d Y H:i:s u",$time), PHP_EOL;
29
30$time = ftp_mdtm($ftp, "D");
31var_dump($time);
32
33$time = ftp_mdtm($ftp, "19990929043300 File6");
34echo date("F d Y H:i:s u",$time), PHP_EOL;
35
36$time = ftp_mdtm($ftp, "MdTm 19990929043300 file6");
37var_dump($time);
38
39?>
40--EXPECT--
41bool(true)
42June 15 1998 10:00:45 000000
43June 15 1998 10:00:45 000000
44July 05 1998 13:23:16 000000
45int(-1)
46October 05 1999 21:31:02 000000
47int(-1)
48