Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    date() Function and it's Parameter


    meijör
     Share

    Recommended Posts

    Hey everyone.

    In this litte Tutorial I'll show you how to handle the date() function.

    The date function needs 2 Parameter, the first is a string in which you specify how the date shall look like.

    As example Monday the 2. March, 2010.

    The second parameter is a unixtimestamp. (The unix timestamp of the actual second in PHP is capable with the time() function.)

     

    The following parameter are available:

     

    d : day as number without starting zero ( ex : 3 )

    j : day as number with starting zero ( ex : 03 )

    w : weekday as number 0-6

    m : month as number with starting zero ( ex : 01,04,11 )

    n : month as number without starting zero ( ex : 1,4,11)

    D : 3 starting letters of the weekday as word (english) ( ex : mon )

    l : weekday outwritten (english) (ATTENTION: small "L" no big "i")

    F : 3 starting letters of the month as word ( ex : jan, dec )

    M : Month in english outwritten

    y : year with 2 last numbers ( ex : 08,09,11)

    Y : Year with 4 numbers ( ex : 2009)

    s : seconds, number with starting zero ( 00-59)

    i : minutes, number with starting zero ( 00-59)

    H : Hour in 24h form with starting zero ( 01-23 )

    G : Hour in 24h form without starting zero ( 1-23 )

     

    Okay enough of that theoretic shit.

     

    My fave example is the example as a clock wich shows the actual time, often used in Homepages.

    The code for this looks like this :

     

    <?
    $now = time(); /*saves the timestamp of this very moment in the variable "now"*/
    $time = date ("d.m.Y - H:i:s",$now);
    
    ?>
    HTML BLUB BLUB BLUB BLUB blablabla(...)
    and now on the position you wanna have the date:
    <?
    echo ("$time");
    ?>

     

     

    I hope it helped, for quesions just ask O.o)

    Link to comment
    Share on other sites

    Nice help for newcomer O.o

    Link to comment
    Share on other sites

    this is what is was meant to be O.o

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...