Categories: wordpress

DATE AND TIME IN WORDPRESS DEVELOPMENT

This article gives idea about two types of date.
THE FIRST
a) date
if you want to show todays date you can use this format

echo “Today is ” . date(“Y/m/d”)

The symbol here
Y: full year (2020)
y: short form of year (20)
m: numerical form of month (7)
M: Alphabetical form of Month (July)
d: date (16)
D: short form of day (Thu)
l: Full form of Day (Thursday)

b) Time
samewse in date() you can echo time like date(h:i:s a)
this gives the hour, minute and second along with am and pm
H: 24 hour format
h: 12 hour format
i: minute (00 to 59)
s: second (00 to 59)
a: shows am or pm

THE SECOND
date of the post

  1. the_date()
    This will give the Date in the F j, Y format ie. JULY 16, 2020
    you can also do echo get_the_date(); for this
  • DATE FORMAT
  • the_date() gives JULY 16, 2020 by default
  • echo get_the_date( l, S M Y ) gives Thursday, 16th July 2020.
  • the_time( ‘g:i a’ ) gives output of 7:30 am
  • echo get_the_time( ‘G:i’ ) give 24 hur format that is 23:20
  • the_time( ‘g:i a, D, j F y’ )gives 2:03 pm, Thu, 16 July 20
jaminrai

Recent Posts

Class XII | Assignment| Chapter 2: Data Communication and Networking

MCQ 1) … Refers to the sending, receiving and processing of information by electronic means.…

6 days ago

Class XI [Chapter 1: Computer System] Assignment

MCQ Which of the following is volatile storage? Backup b. RAM                 c. ROM                 d. Tape…

1 week ago

Class XI Chapter 2 Number system [ASSIGNMENT]

MCQ 1. We have ....... universal gatges a. 1      b. 0     c.…

2 weeks ago

What is Topology?

  DOWNLOAD  PDF  HERE!!!!!! topology

3 weeks ago

Class XII | Assignment 2 ( C Structure)

STRUCTURE (Submit after Mid Term , 15 Ashad 2083) A) MCQ 1. What is the…

1 month ago

Class XII Assignment 1 ( C Function )

FUNCTION (Assignment) Submit Before Mid Term MCQ 1. What is the output of this statement…

1 month ago