time and date function

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

  • morse
    replied
    Originally posted by kiLLeR-eyEd_14 View Post
    then add 1 day and 1day and 1 day
    you are joking right?

    Leave a comment:


  • kiLLeR-eyEd_14
    replied
    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

    Leave a comment:


  • morse
    replied
    a predicting sunday, monday, tuesday etc for somebodys forthcomming birthday

    Leave a comment:


  • CreativityKills
    replied
    ? Dnt get. Maybe if u say why, or what u want 2 use it 4. . .we wud.

    Leave a comment:


  • morse
    replied
    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

    Leave a comment:


  • CreativityKills
    replied
    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);

    Leave a comment:


  • morse
    replied
    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.

    Leave a comment:


  • CreativityKills
    replied
    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. . .

    Leave a comment:


  • subzero
    replied
    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

    Leave a comment:


  • morse
    replied
    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

    Leave a comment:


  • subzero
    replied
    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.

    Leave a comment:


  • morse
    started a topic time and date function

    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?
Working...
X