Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

PHP Data and Time Function

            

   PHP Data and  Time

The  dete() function accept a format string as parameter 
formate the local date and time specified format 

Syntax :- 

mktime(hour, minute, second, month, day, year)
 
date(format,timestamp)


 data () funtion 

 d = Represents the day of month (1 to 31)
m = Represen
ts a month (1 to 12)
y = Represents a year (4 digits)
l = Represents the day of the  week


Time () Function :-

   Returns the Current time in the  number of the  seconds 
  time() function  used return the courrent time 


H - 24 - hour (00 to 23)
i - Minutes with (00 to 59)
s - Second with leading (00 to 59 )
a - Lowercase ante meridiem and post meridiem (am to pm)


    Default timezone 

      date _default_timezone_set('UTC');

        ፨ Default Timezone UTC 

   ஃ Current date and time

        $currentDateTime = date('Y-m-d H:i:s') ;       

              ፨ YYYY-MM-DD-HH-MM:SS     

   ஃ Current date format

       $currentDate = date('F j,Y');

              Month day , Year

   ஃ Current time 

      $currentTime12Hr = date('h:i:s A');

                hh: mm:ss AM/PM

  
 

  Example :-

<?php
echo "Today is " . date("y/m/d") .  "<br>";
echo "Today is" . date("y.m.d")  .  "<br>";
echo "Today is" . date(y-m-d")  ."<br>";
echo "Today is ". date("l");

?>

 Output :-




 

2] Date :- 

Example 


<?php
$day =date("d/m/y");
echo $day;


 Output :-

 

3]  Day :- 

  Example :-


<?php

echo "Today is ". date("l");

?>

Output :-




  

  4]  Date  :-

Example :-'

<?php

$d= mktime(11,14,54,8,12 ,2014);
echo " date " . date("y-m-d h:i:sa");

?>

Output :-




5]  Date()  Function :-

Example :-


<?php
$date =date ("D . M .D .Y");
print("Date :- <br>". $date);
?>


OutPut :-


6] Date()  Function :-

Example:-


<?php
$date = date("D M d y");

print ("Date :-". $date);
?>

Output :-


7] 

Example:-

<?php
   date_default_timezone_set('UTC');
   
   echo date("l");
   echo "
";
   
   echo date('l dS \of F Y h:i:s A');
   echo "
";
?>

Output :-




Related Post :-

Registration form in php

html color tag

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example