Results 1 to 5 of 5

Thread: PHP, date...

  1. #1
    MerryVIP
    Guest

    PHP, date...

    Hi,

    I want to get date, just the number of day in month. Then, the month number and replace it with string version.

    In VB I would do like this:
    Code:
    Dim Temp As String
    Temp = Format(Day, "#") & ". "
    Select Case Val(Format(Month, "#"))
        Case 1
            Temp = Temp & "tammi"
        Case 2
            Temp = Temp & "helmi"
        Case 3
            Temp = Temp & "maalis"
        Case 4
            Temp = Temp & "huhti"
        Case 5
            Temp = Temp & "touko"
        Case 6
            Temp = Temp & "kesä"
        Case 7
            Temp = Temp & "heinä"
        Case 8
            Temp = Temp & "elo"
        Case 9
            Temp = Temp & "syys"
        Case 10
            Temp = Temp & "loka"
        Case 11
            Temp = Temp & "marras"
        Case 12
            Temp = Temp & "joulu"
    End Select
    Temp = Temp & "kuuta"
    So how I can do this in PHP?

    Thanks in advance, reply with e-mail if possible ([email protected]),

  2. #2
    scoutt
    Guest
    you mean something like this,

    to get the date and then print it out on the screen
    Code:
    <?
    $string = date("[m/d/Y]"); // 6/10/2001
    
    echo" $string";
    
    or
    
    print" (date ("l dS of F Y"))"; // 1st of January 2001
    
    
    ?>
    I think something like that will work. is that what you wanted?
    it all depends on what format you want

  3. #3
    MerryVIP
    Guest
    Humm...Well, more likely I would like to know how I could make a wanted number (1 to 12) into a string...Like 1 would be January (tammikuu, we write months lower case). I just want to have the dates in Finnish.

    I've seen something like:

    "Tammi*Helmi*Maalis*Huhti...etc."

    Somekind of array methinks...I just don't understand how it works.

  4. #4
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    Try this:


    Dim i As Integer
    Dim fechas As String
    i = InputBox("Month number (1/12)")

    fechas = "JanFebMarAprJunJulAguSepOctNovDic"

    MsgBox Mid(fechas, i * 3 - 2, 3)



    Hope this helps
    "The difference between mad and genius is the success"

  5. #5
    MerryVIP
    Guest
    PHP, not VB. I just gave an example in VB to show what I want. And I got helped in other thread already. Thanks anyways

Posting Permissions

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



Click Here to Expand Forum to Full Width