php date function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dentnick
    New Member
    • Jan 2010
    • 1

    php date function

    Hi,
    I am new to all this.
    I try to run a website which uses the php date function to display date and time.
    The problem is that i am from Greece.
    The only problem i have is with the months display.
    It shows Jan Feb etc.
    I would like to see them in Greek or if this is diffidcult at least to see months in numeric fromat from 1 to 12.
    I attach here the functions_date. php in text format in case someone can help.

    Regards,

    Nick
    Attached Files
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    You should have everything you need in the manual:



    If you want greek months, then just create a small 12 item associative array with the month number as the key and the greek month as the value.

    Code:
    $greekMonths = array('Ianouarios','Fevrouarios','Martios','Aprilios','Maios','Iounios','Ioulios','Avgoustos','Septemvrios','Oktovrios','Noemvrios','Dekemvrios');
    
    $greekDate = date('d') . ' ' . $greekMonths[intval(date('m'))-1] . ' ' . date('Y'); 
    echo $greekDate;
    Which as of this posting displays: 19 Ianouarios 2010

    Something like that should work for you,






    Dan
    Last edited by dlite922; Jan 19 '10, 05:04 PM. Reason: Forgot to -1 for the month to adjust to array index.

    Comment

    Working...