PHP Date And Time

PHP Date And Time In Hindi – Date And Time Function In Hindi

PHP

PHP Date And Time In Hindi Date And Time Function In Hindi:- PHP Date And Time Ka Istemal PHP Ke Sath Sath Programming Languages Main Kiya Jata Hain. PHP Main Date And Time Ke Liye date() or time() Functions Diye Gaye Hain |

PHP Date And Time In Hindi

date() or time() In 2 function se date Or time Ko output Mai display Kiya Jata Hain |

PHP Date Functions In Hindi

Syntax for date()

date(date_format, timestamp);
  • date_format: Yaha Par Aap date Ka format Diya Jata Hain | Ye current date print Karta Hai And Ye timestamp Ko date/time format Mai convert Kar Deta Hain |
  • timestamp: Yaha Par Ye optional Rahta hai| Agar Koi value Di Nhi Jati To Current timestamp Diya Jata Hain |
  • 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

Example

<?php
echo "Current Date : ".date("d/m/y")."<br />";	
echo "Current Time : ".date("H:i:sa")."<br />";
echo "Current Day : ".date("l")."<br />";
echo "Current Month : ".date("M")."<br />";		
?>

Output:

Current Date : 09/08/20
Current Time : 14:09:25pm
Current Day : Sunday
Current Month : Aug

Aap Dekh Sakte Hain Hamne Current Date And Time Print Kar Liya Hain |

PHP time Function in Hindi

Timestamp Ye Readable Nhi Hota Hai Ise Understand Karne Ke Liye date() Function Ka Istemal Karna Padta Hain | Timestamp Main time() Function Ka Istemal Kiya Jata Hain |

Example:

<?php 
echo "Current Time : ".time();
 ?>

Output:

Current Time : 1596975475

PHP Get Time Zone In Hindi

Ham Ab date() Function Ki Help Se India Ka Time Zone Print karane Wale Hain |

Example:

<?php 
date_default_timezone_set('Asia/Kolkata');

echo date('d-m-Y g:i a');
?>

Output:

09-08-2020 5:52 pm

PHP mktime() Function in Hindi

mktime() Function Ka Istemal Karke Ham Time Ko Create Kar Sakte Hain |

Syntax:

mktime(hour, minute, second, month, day, year)

Example:

<?php

//mktime(hour, minute, second, month, day, year)
$d=mktime(06, 00, 54, 8, 09, 2020);
echo "Created date is " . date("Y-m-d h:i:sa", $d);
?>

Output:

Created date is 2020-08-12 11:14:54am

PHP strtotime() Function in Hindi

strtotime() Function Keval String Ko Convert Karke Numbric Main Show Karta Hain Time Ko Wo Bhi Date() Function Ki Help Se |

Syntax

strtotime(time, now)

Example:

<?php
$d=strtotime("10:30pm April 15 2020");
echo "Created date is " . date("Y-m-d h:i:sa", $d);
?>

Output:

Created date is 2020-04-15 10:30:00pm

Yadi Aapne  HTML Full Course  And CSS Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *