![]() ![]() The developer or coder must be aware of the specified string date as a parameter. We can use this strtotime() PHP built-in function whenever required. We can set the time zone to any zone as per the requirements. Also, I am setting the current time zone to Asia/Kolkata so that we can get the date as per the India perspective. Modify the above program bit more to the human-readable date along with these timestamps. It totally depends on when we run this program. Output at the time of running the above code, you will see the different outputs. As we know changing the string date to the timestamp is the main function of the strtotime() function.Ĭhanging the string date to the actual date. Example #2Ĭhange the dates to the timestamp. We will see the different output as per the current date. ![]() Please note that, this output was at the time of writing and running this program. Here we begin with the combing above code as a program and see the output. Given below are the examples mentioned: Example #1 Now, we will use another function to get the human-readable date from this timestamp. This line of code will give us the current timestamp. For this, first, we have to get the current timestamp then we can use the other date function to get the exact date from that timestamp. We can simply follow the syntax of this function and can start using it as per our business requirements.įor Example: If someone wants to know the current date (means which date is going on today) we can use this function. There are no additional plugins or the extensions are required before using this function. This function is one of the basic functions in the PHP language. Till now, various extensions have been made in this function. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |