You can simply use the PHP
date() function to get the current data and time in various format, for example,
date('d/m/y H:i:s'), and so on.
Try out the following example to see how it basically works:
<?php // Return current date from the remote server $date = date('d-m-y h:i:s'); echo $date; ?>
The date and time returned by the above example is based on the server's default timezone setting. If you want to show date and time as per user's timezone, you can set the timezone manually using the
date_default_timezone_set() function before the
date() function call.
The following example shows the date and time in India timezone which is
<?php // Set the new timezone date_default_timezone_set('Asia/Kolkata'); $date = date('d-m-y h:i:s'); echo $date; ?>
How to show and hide div elements based on the click of checkboxes in jQueryUse the jQuery toggle() method The fo...
Get The Difference Between Two Date In Laravel Using jpmurray/laravel-countdownToday, Laravelcode share with you how to...
How to create jQuery slide left and right toggle effectUse the jQuery animate() metho...
How to Get the ID of the Element that Fired an Event in jQueryUse the event.target Property You can...
How to highlight alternate table row using jQueryUse the jQuery :nth-child() se...