<SCRIPT language=JavaScript>
        <!-- Hide the script
        //
        // This is a y2k compliant script which prints the system date to
the screen,
        //
        // You may use this script in your website provided that this notice
remains at the top
        //
        
        var months=new Array(13);       // set up an array for string
literal months
        months[1]="January";            // array starts at [1] rather than
[0] for
        months[2]="February";           // familiar month numbering
convention, could
        months[3]="March";              // just as easily be [0..11] but
that is less clear
        months[4]="April";
        months[5]="May";
        months[6]="June";
        months[7]="July";
        months[8]="August";
        months[9]="September";
        months[10]="October";
        months[11]="November";
        months[12]="December";
          
        var today=new Date();                           // store date in
today
              
        var lmonth=months[today.getMonth() + 1];        // pull out month
name
        var date=today.getDate();                       // pull out
numerical date
        var year=today.getFullYear();                   // pull out
numerical year
        var daynum = today.getDay() + 1;                // pull out day
number
                
        if(daynum==1) day = "Sunday";                   // match day name to
day number
        if(daynum==2) day = "Monday";
        if(daynum==3) day = "Tuesday";
        if(daynum==4) day = "Wednesday";
        if(daynum==5) day = "Thursday";
        if(daynum==6) day = "Friday";
        if(daynum==7) day = "Saturday";
           
        // make entire date into one variable, allows easy adjustment of
format
           
        // us format: var todaysdate= (day + ", " + date + " " + lmonth + "
" + year);
        var todaysdate= (day + ", " + lmonth + ", " + date + " " + year);
        
        // write date to screen
        document.write(todaysdate);
        // end hiding-->  
        </SCRIPT>

Hope this helps.


-----Original Message-----
From: Adam Williams [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 December 2003 8:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] date conversion


Hi, is there a PHP function that will convert MM/DD/YYYY to YYYYMMDD?  
Also I will need to take into affect some people may put in M/D/YYYY (some 
people may put in 1 instead of 01, 2 instead of 02, etc).  Is there a way 
to do this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Netway Networks Pty Limited
t   02 - 8920 8877 
f   02 - 8920 8866 
e   [EMAIL PROTECTED] 
w   http://www.netwaynetworks.com.au 

Reply via email to