#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    33
    Rep Power
    15
    i'm wondering what is the best way to
    set the date as follow :
    monday, 12 april 2000 but it must be
    the local date of the netherlands,
    and i want this as output :

    Maandag, 12 april 2000.

    so i want the name of the day in the dutch
    language.

    i can work with array, and get the day number
    out of it, but i think php is so good,
    that it might have a nice function for this
    already :-))

    who gives me a good example ??

    Thanks for any help !

    Jan, The Netherlands.

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    Redmond, WA
    Posts
    218
    Rep Power
    15
    use the date() function..

    date("l, d F Y")

    the l above is a lowercase L, not the number one.

    this will return:

    Sunday, 30 April 2000

    I know this doesn't really answer your question, but.. at least it might give you a bit of a start.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Use strftime() and setlocale(). Personally, I have no idea how the latter of those work, but strftime() is a common c function that lets you format the date similar to date(), but supports locale settings. So, as my understanding is, you can do something like this:

    setlocale("LC_TIME","");
    $date = strftime("%A, %d %B %Y",time());

    * Please note, that I've never tinkered around with locales, so I have no idea if this code will work.

    [This message has been edited by cka (edited April 30, 2000).]
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    15
    Try this!
    <?php
    $name_day[0] = "Maandag";
    $name_day[1] = "Lundi";
    $name_day[2] = "Mardi";
    $name_day[3] = "Mercredi";
    $name_day[4] = "Jeudi";
    $name_day[5] = "Vendredi";
    $name_day[6] = "Samedi";

    $name_month[1] = "january";
    $name_month[2] = "february";
    $name_month[3] = "march";
    $name_month[4] = "april";
    $name_month[5] = "may";
    $name_month[6] = "june";
    $name_month[7] = "july";
    $name_month[8] = "august";
    $name_month[9] = "september";
    $name_month[10] = "october";
    $name_month[11] = "november";
    $name_month[12] = "december";


    $num_day = date( "w");
    $num_month = date( "m");

    $test = substr($name_month,0,1);
    if ($test == "0") {
    $num = substr($name_month,1,1);
    $name_month = $num;
    }


    $year = date( "Y");
    $n = date( "d");

    $day = $name_day[$num_day];

    $month = $name_month[$num_month];

    print($day. " ".$n. " ".$month. " ".$year);

    ?>

    [This message has been edited by dalida (edited May 03, 2000).]

    [This message has been edited by dalida (edited May 03, 2000).]

Similar Threads

  1. permissions after uploading
    By Paul Niessen in forum Perl Programming
    Replies: 3
    Last Post: February 15th, 2004, 06:51 PM
  2. Help with HTML Parsing
    By musashiBRS in forum Python Programming
    Replies: 6
    Last Post: February 13th, 2004, 03:32 AM
  3. Writing to two *.csv files
    By CAR in forum Perl Programming
    Replies: 4
    Last Post: February 7th, 2004, 05:39 PM
  4. need help with testing non-alphanumeric input
    By pinkipodmini in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 02:48 PM
  5. howto get NICK_NAME and print results?
    By marnixvandalen in forum Perl Programming
    Replies: 0
    Last Post: January 5th, 2004, 02:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo