Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php print datetime

Get a Time
  
  echo "The time is " . date("h:i:sa");

Here are some characters that are commonly used for date:

d - Represents the day of the month (01 to 31)
m - Represents a month (01 to 12)
Y - Represents a year (in four digits)
l (lowercase 'L') - Represents the day of the week

Here are some characters that are commonly used for times:

H - 24-hour format of an hour (00 to 23)
h - 12-hour format of an hour with leading zeros (01 to 12)
i - Minutes with leading zeros (00 to 59)
s - Seconds with leading zeros (00 to 59)
a - Lowercase Ante meridiem and Post meridiem (am or pm)
  
  
  
 
PREVIOUS NEXT
Tagged: #php #print #datetime
ADD COMMENT
Topic
Name
6+9 =