View Full Version : Curtime() function in php
03-11-2009, 07:11 PM
In my database it has a time attibute but curtime() returns only like 11.12.23 etc not am or pm. but i need to know specifically whether it is am or pm
03-12-2009, 02:26 AM
curtime() is not a php function. If you're having issues with it, you'll have to take it up with whatever database system you are using (mysql?). My suggestion then would be to just use php to get the current time, i.e.: time()
03-12-2009, 04:50 AM
curtime() is not a php function.
I think date() function is what you are looking for.
Below is the usage of date() function.
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today = date("m.d.y"); // 03.10.01
$today = date("j, n, Y"); // 10, 3, 2001
$today = date("Ymd"); // 20010310
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today = date('\i\t \i\s \t\h\e jS \d\a\y.'); // it is the 10th day.
$today = date("D M j G:i:s T Y"); // Sat Mar 10 17:16:18 MST 2001
$today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:18 m is month
$today = date("H:i:s"); // 17:16:18
for more info on date() functio click here (http://in2.php.net/date).
03-12-2009, 09:44 AM
oki i got it.thanks
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.