time and date function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    time and date function

    I have
    $a = day
    $b= month
    $c=year
    Now i want to show the date in the format $a $b $c
    How to use the time function? because when i echo "date($a $b $c)"; it gives me errors. How to echo it right?
    tinyurl.com/earnbymobile
    Easy earning for Indians
    ---------------------
    Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
    goo.gl/6vub3

    #2
    PHP Code:
                   $year date("Y");
                   
    $day date("D");
                   
    $mounth date("M");
    echo 
    "$day,$mouth,$year";

    $TimeZone="8"////Change the TimeZone accordingly! 
    $New_Time time() + ($TimeZone 60 60); 
    $show_time=date("H:i",$New_Time);  
    $Hour=date("G",$New_Time); 

    echo 
    "<div>$show_time</div>"
    Last edited by subzero; 12.08.09, 14:34.
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      That would just echo current date, current month and current year bro, i want to echo a specific date, month and time whose values are there in the $a , $b and $c variables
      tinyurl.com/earnbymobile
      Easy earning for Indians
      ---------------------
      Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
      goo.gl/6vub3

      Comment


        #4
        PHP Code:
                       $date date("a");
                       
        $day date("b");
                       
        $mounth date("c");

        echo 
        "<p class=\"sub\">© $day,$mounth,$date  $ctest</p>\n"
        2009-08-13T01:49:05+09:30,am
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          Originally posted by morse View Post
          That would just echo current date, current month and current year bro, i want to echo a specific date, month and time whose values are there in the $a , $b and $c variables
          dude, the date() works with unix time stamp. So if u want 2 echo a specific dat, u'd avta knw its correct timestamp in seconds and do sumot like:
          echo date("d m y",$tmstamp);

          NOTE: you can use strtotime() to convert string to time. Read php.net for more info. . .

          Comment


            #6
            Php does has a functionality to echo day, date, month and year in a specific format if we provide the variables correctly, but for some reason am unable to echo proper results, i end up echoing Wednesday 31st december for all the different variable values. I did read the manual and they havent explained php date and time functions that very well.
            tinyurl.com/earnbymobile
            Easy earning for Indians
            ---------------------
            Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
            goo.gl/6vub3

            Comment


              #7
              To undastand wot i sed earlyer i'l explain quickly d date function. It accepts 2 parameters.
              First, the format string, this tells the date function how to format the date its bring. The second parameter, this specifies the time u want to format in UNIX timestamp (seconds since 1, jan 1970, i guess) if left blank, date() uses d current date time stamp aka time() bt if u already ava date u want to output, just specify it as d 2nd parameter(in timestamp).
              U cud generate a timestamp urself.
              Code:
              $daysago = 20; //replace wit watever
              $tmstmp = time() - ($daysago * 24 * 60 * 60);
              echo date("d m y",$tmstmp);

              Comment


                #8
                maybe we both are not understanding each other, i can interpret what you meant by timestamp but it not an issue for me i just want
                Code:
                [COLOR=#000000][COLOR=#0000bb]date[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"l"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]mktime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]7[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]2000[/COLOR][COLOR=#007700]))[/COLOR][/COLOR]
                to work with my input variables, which for some unknown reason is not working and making me go nuts
                tinyurl.com/earnbymobile
                Easy earning for Indians
                ---------------------
                Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
                goo.gl/6vub3

                Comment


                  #9
                  ? Dnt get. Maybe if u say why, or what u want 2 use it 4. . .we wud.

                  Comment


                    #10
                    a predicting sunday, monday, tuesday etc for somebodys forthcomming birthday
                    tinyurl.com/earnbymobile
                    Easy earning for Indians
                    ---------------------
                    Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
                    goo.gl/6vub3

                    Comment


                      #11
                      Originally posted by morse View Post
                      a predicting sunday, monday, tuesday etc for somebodys forthcomming birthday
                      then add 1 day and 1day and 1 day
                      My Blog: http://jhommark.blogspot.com
                      My Facebook: http://www.facebook.com/jhommark
                      My Official Site: http://www.undergroundweb.tk
                      My Community Site: http://undergroundwap.xtreemhost.com

                      Comment


                        #12
                        Originally posted by kiLLeR-eyEd_14 View Post
                        then add 1 day and 1day and 1 day
                        you are joking right?
                        tinyurl.com/earnbymobile
                        Easy earning for Indians
                        ---------------------
                        Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
                        goo.gl/6vub3

                        Comment

                        Working...
                        X