Recommended Answers
Jump to PostIf you want current date and time to insert to a table, you can use now() function of mysql.
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now
Jump to Post<?php $time_now=mktime(date('h')+5,date('i')+30,date('s')); print "<br>".date('h:i:s A',$time_now); ?>
Thats for php.
Cheers,
Naveen
Jump to PostI am getting the right output. i am getting 03:14:16 PM which is the right time.
$time_now=mktime(date('h')+5,date('i')+30,date('s'));
date('h')+5 will add 5 hrs to UTC time.
date('i')+30 will add 30 mins to UTC time.Since we are 5-30 hrs ahead of UTC time, i am sure this will …
All 12 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.