1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help on how to change dates and language

Discussion in 'HTML & JavaScript' started by administer, Mar 23, 2012.

  1. administer

    administer Registered Member

    Joined:
    Nov 19, 2008
    Messages:
    73
    Likes Received:
    1
    Moved from here to php
     
    Last edited: Mar 24, 2012
  2. mmslax2

    mmslax2 Newbie

    Joined:
    Feb 7, 2012
    Messages:
    34
    Likes Received:
    11
    First off this is PHP not jquery. Anyways, after a quick glimplse change
    PHP:
    //convert to time
        
    $lasttime=mktime(0,0,0,$_POST['datemonth'],$_POST['dateday'],$_POST['dateyear']);
    To:
    PHP:
    //convert to time
        
    $lasttime=mktime(0,0,0,$_POST['dateday'],$_POST['datemonths'],$_POST['dateyear']);
    In order to change the months you need to edit the $months array which is below:
    PHP:
    $months=array('','January','February','March','Apr  il','May','June','July','August',
        
    'September','October','November','December');
    I'm not a pro, but that should get the job done. I didn't look into it very much, so if it doesn't work let me know and I'll look further.
     
    Last edited: Mar 23, 2012
  3. tripper_john_md

    tripper_john_md Newbie

    Joined:
    Feb 21, 2011
    Messages:
    40
    Likes Received:
    35
    Location:
    Southern Germany
    The original posting moved, but to add something to mmslax's post:
    You can't change the order inside mktime, it creates a timestamp and the function needs this particular order of the input. :)
    All you achieve with changing the order inside mktime is a wrong timestamp.
     
  4. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,520
    Likes Received:
    10,570
    Occupation:
    Full-time Knitter
    Location:
    Buenos Aires