Searching...
Jumat, 28 Maret 2014

Format Tanggal Date Di Php

Jumat, Maret 28, 2014

Format Tanggal date di PHP

Saya akan coba membahas fungsi Format Tanggal date di php, yaitu fungsi untuk merubah tanggal supaya sesuai dengan format Tanggal Indonesia

dalam PHP dasarnya penulisan tanggal adalah dengan format "tahun-bulan-tanggal" contoh "2014-03-14", nah tentu saja kita ingin menggunakan format tanggal "tanggal-bulan-tahun" dalam bahasa Indonesia.

langsung saja ini source code nya :

<?php
$tanggalphp="2014-03-14";
$tanggalind = date('d M Y', strtotime($tanggalphp));
echo "Tanggal Inggris $tanggalphp";
echo "<br>";
echo "Tanggal Indonesianya: $tanggalind";
?>


Hasil Jadinya :
Tanggal Inggris 2014-03-14
Tanggal Indonesianya: 14 Mar 2014


Apabila ingin berkreasi lebih indah, coba cobalah dengan parameter yang berbeda seperti di bawah ini,

Berikut ini Parameter fungsi date pada PHP yang bisa di deklarasikan:


  • d - The day of the month (from 01 to 31)
  • D - A textual representation of a day (three letters)
  • j - The day of the month without leading zeros (1 to 31)
  • l (lowercase 'L') - A full textual representation of a day
  • N - The ISO-8601 numeric representation of a day (1 for Monday, 7 for Sunday)
  • S - The English ordinal suffix for the day of the month (2 characters st, nd, rd or th. Works well with j)
  • w - A numeric representation of the day (0 for Sunday, 6 for Saturday)
  • z - The day of the year (from 0 through 365)
  • W - The ISO-8601 week number of year (weeks starting on Monday)
  • F - A full textual representation of a month (January through December)
  • m - A numeric representation of a month (from 01 to 12)
  • M - A short textual representation of a month (three letters)
  • n - A numeric representation of a month, without leading zeros (1 to 12)
  • t - The number of days in the given month
  • L - Whether it's a leap year (1 if it is a leap year, 0 otherwise)
  • o - The ISO-8601 year number
  • Y - A four digit representation of a year
  • y - A two digit representation of a year
  • a - Lowercase am or pm
  • A - Uppercase AM or PM
  • B - Swatch Internet time (000 to 999)
  • g - 12-hour format of an hour (1 to 12)
  • G - 24-hour format of an hour (0 to 23)
  • h - 12-hour format of an hour (01 to 12)
  • H - 24-hour format of an hour (00 to 23)
  • i - Minutes with leading zeros (00 to 59)
  • s - Seconds, with leading zeros (00 to 59)
  • u - Microseconds (added in PHP 5.2.2)
  • e - The timezone identifier (Examples: UTC, GMT, Atlantic/Azores)
  • I (capital i) - Whether the date is in daylights savings time (1 if Daylight Savings Time, 0 otherwise)
  • O - Difference to Greenwich time (GMT) in hours (Example: +0100)
  • P - Difference to Greenwich time (GMT) in hours:minutes (added in PHP 5.1.3)
  • T - Timezone abbreviations (Examples: EST, MDT)
  • Z - Timezone offset in seconds. The offset for timezones west of UTC is negative (-43200 to 50400)
  • c - The ISO-8601 date (e.g. 2013-05-05T16:34:42+00:00)
  • r - The RFC 2822 formatted date (e.g. Fri, 12 Apr 2013 12:01:05 +0200)
  • U - The seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)

    Demikian Artikel Format Tanggal Date Di Php. semoga bermanfaat... ^_^

0 komentar:

Posting Komentar

Labels

php (7) Array (2) Variabel (2) arti php (2) kepanjangan php (2) membuat website (2) pengertian php (2) Bilangan Ganjil (1) Bilangan Genap (1) Bilangan Prima (1) Bulan PHP (1) Database Agama Dengan Array (1) DoWhile (1) FOpen (1) For (1) Format Date (1) Format Tanggal (1) Function Date function tanggal (1) Fungsi Date (1) Ganjil (1) Ganjil Genap (1) Genap (1) Genap Ganjil (1) Index Agama array (1) Install Xampp (1) Loop (1) Looping (1) Marquee (1) Membaca file txt (1) Membuat Button Bulan Tahun Dengan PHP (1) Membuat Nomor urut (1) Membuka File txt (1) Merubah Huruf Besar Ke Kecil (1) Merubah Huruf kecil Menjadi besar di PHP (1) Mod (1) Nomor Urut (1) Nomor Urut PHP (1) Notepad (1) Notepad++ (1) Perbedaan Antara FOR WHILE Dan DOWHILE (1) Perulangan (1) Prima (1) Rubah huruf besar ke kecil (1) Substring PHP (1) Tahun PHP (1) Tanggal Date (1) Tanggal Date PHP (1) Teks Berjalan (1) Web Browser (1) While (1) Xampp (1) Xampp 1.6.4 (1) agama array (1) array agama (1) belajar php (1) besar ke kecil (1) bgcolor (1) cari karakter dalam karakter (1) fungsi tanggal (1) fungsi variabel (1) huruf kecil jadi besar (1) index agama (1) index agama menggunakan array (1) jumlah karakter (1) memecah String (1) merubah huruf (1) merubah huruf kecil ke besar (1) panjang karakter (1) pencarian karakter (1) pengertian variabel php (1) php adalah (1) sejarah php (1) singkatan php (1) strlen (1) strpos (1) strtolower (1) strtoupper (1) substr (1) substr PHP (1) tr (1) tr bgcolor (1) tr bgcolor tag html (1) tr html (1) tr tag html (1) variabel $ (1) variabel di php (1) variabel global (1) variabel lokal (1) variabel static (1)