Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Curtime() function in php

    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

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    52
    Thanks
    4
    Thanked 6 Times in 6 Posts
    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()

  • #3
    New Coder
    Join Date
    Feb 2009
    Posts
    38
    Thanks
    0
    Thanked 1 Time in 1 Post
    curtime() is not a php function.
    I think date() function is what you are looking for.
    Below is the usage of date() function.
    PHP Code:
    <?php
    // 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.

  • Users who have thanked milanchheda for this post:

    oesxyl (03-13-2009)

  • #4
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    2
    Thanked 0 Times in 0 Posts
    oki i got it.thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •