PHP 时间对象处理

date — Format a local time/date

PHP: date - Manual

1
date(string $format, ?int $timestamp = null): string

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// set the default timezone to use.
date_default_timezone_set('UTC');


// Prints something like: Monday
echo date("l");

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

/* use the constants in the format parameter */
// prints something like: Wed, 25 Sep 2013 15:28:57 -0700
echo date(DATE_RFC2822);

// prints something like: 2000-07-01T00:00:00+00:00
echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));

time — Return current Unix timestamp

PHP: time - Manual

1
time(): int

Example

1
2
3
4
5
6
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60 secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";

mktime — Get Unix timestamp for a date

1
2
3
4
5
6
7
8
mktime(
int $hour,
?int $minute = null,
?int $second = null,
?int $month = null,
?int $day = null,
?int $year = null
): int|false

Example

1
2
3
4
5
6
7
8
// Set the default timezone to use.
date_default_timezone_set('UTC');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

// Prints something like: 2006-04-05T01:02:03+00:00
echo date('c', mktime(1, 2, 3, 4, 5, 2006));

Oracle

History

Version Release Date
Oracle v2 1979
Oracle v3 1983
Oracle v4 1984
Oracle v5 1985
Oracle v6 1988
Oracle7 1992-06
Oracle8 1997-06
Oracle8i 1998
Oracle9i 2001
Oracle10g R1 2003
Oracle10g R2 2005-06
Oracle11g R1 2007-09
Oracle11g R2 2009-09
Oracle12c R1 2012-07
Oracle12c R2 2016-09
Oracle18c 2018-02

Tutorial

Oracle Database Online Documentation 11g Release 2 (11.2)

配置监听

1
cd $ORACLE_HOME/network/admin