Minggu, 04 Mei 2014

Bab 14 PHP Date()

Bab 14 PHP Date() Fungsi date() digunakan untuk memformat waktu dan tanggal. Sintaks date(format,timestamp) Parameter Keterangan format Required. Specifies the format of the timestamp timestamp Optional. Specifies a timestamp. Default is the current date and time (as a timestamp) Timestamp Timestamp adalah jumlah detik sejak January 1, 1970 00:00:00 GMT. Juga dikenal sebagai Unix Timestamp. Format Tanggal • d – format hari (01-31) • m – format bulan (01-12) • Y – format tahun Program14-1.php "; echo date("Y.m.d"); echo "
"; echo date("Y-m-d"); ?> output: 2006/07/11 2006.07.11 2006-07-11 Fungsi mktime() akan memberikan nilai Unix timestamp untuk tanggal tertentu. Sintaks mktime(hour,minute,second,month,day,year,is_dst) Program14-2.php output: Tomorrow is 2006/07/12

0 komentar:

Posting Komentar