Posts marked with "Date" in tags

MySQL NOW() in JavaScript (UTC & Local)

If you know MySQL, you will certainly know the NOW() function that outputs the current date and time with the timezone of the MySQL server. For easy use and compatibility, we use UTC time zone for storing time in database. If you are running a web app that comply with MySQL, then you need the date function as same as the NOW(). So, I will give you a small function that return the same value as MySQL’s NOW() function in both UTC and local time.... [READ MORE]

How to get Current Time and date in Javascript

This tutorial will help you to get current date and time at which the function is executed. Here is the function: function ctime(){ var currentdate = new Date(); var time=currentdate.getFullYear()+"-"+(currentdate.getMonth()+1)+"-"+currentdate.getDate()+" "+currentdate.getHours()+":"+currentdate.getMinutes()+":"+currentdate.getSeconds(); return time; } Just print out ctime() function to get the date and time in the format YEAR/MONTH/DAY HOUR:MINUTE:SECOND  Explanation : new Date() function prints out the current date and time in a disorderly way. You can order it in any way as I did in the time() function.... [READ MORE]

The best age calculation code in PHP

Age calculation is a tricky calculation especially in Programming Languages. I’m going to tell you a simple way to find out age in PHP. This is a simple function that will calculate age if it is given a birthday date in the format date/month/year. For example : 20/01/2000 or 04/12/1990 Here is the function : function age($birthday){  list($day,$month,$year) = explode("/",$birthday);  $year_diff  = date("Y") – $year;  $month_diff = date("m") – $month;  $day_diff   = date("... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab