Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Location
    Iceland
    Posts
    10

    Question Unanswered: Date_format %m %w

    Hello

    I have a database for a website (php) and I am getting date out of the database. I wan't to use the %M and %W functions (getting days and months by name, http://www.mysql.com/doc/en/Date_and...functions.html) but since the website is designed in other language I was wondering how to change it? (I mean sunday to other name etc.)
    Can I do it or is it bound to the server?

    Thanks in advance!

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320

    Re: Date_format %m %w

    Originally posted by server
    Hello

    I have a database for a website (php) and I am getting date out of the database. I wan't to use the %M and %W functions (getting days and months by name, http://www.mysql.com/doc/en/Date_and...functions.html) but since the website is designed in other language I was wondering how to change it? (I mean sunday to other name etc.)
    Can I do it or is it bound to the server?

    Thanks in advance!
    It is not a good solution to use days by name. You should use an arrays to retreive days by name using the days number in the week

    ex daysinfrench[0] = lundi
    daysinfrench[1] = mardi
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Dec 2002
    Location
    Iceland
    Posts
    10
    No, this is not what I meant

    What I mean is that I have some date in the database, say I wan't to print that to a website using DATE_FORMAT(DATE, '%W %e %M %Y').
    Say I would have in DATE column and in one row is this, 2002-01-05, and then I would use a SELECT command with the date_format above it would echo:
    Sunday 5 January 2003
    But my problem is that I would like it to echo
    Sunnudagurin 5 Janúar 2003 which which is the same names in icelandic.
    Can I do that?

    I hope you understand me better now

    Thanks in regards

  4. #4
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Originally posted by server
    No, this is not what I meant

    What I mean is that I have some date in the database, say I wan't to print that to a website using DATE_FORMAT(DATE, '%W %e %M %Y').
    Say I would have in DATE column and in one row is this, 2002-01-05, and then I would use a SELECT command with the date_format above it would echo:
    Sunday 5 January 2003
    But my problem is that I would like it to echo
    Sunnudagurin 5 Janúar 2003 which which is the same names in icelandic.
    Can I do that?

    I hope you understand me better now

    Thanks in regards
    No only if you decide to recompile some mysql function or to create your own user fonction
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  5. #5
    Join Date
    Dec 2002
    Location
    Iceland
    Posts
    10
    Ok, thanks for the reply!

Posting Permissions

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