Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Convert String to Date

Mon Oct 27, 2008 12:37 pm

Code:
<HTML>
<BODY>
<FORM METHOD="POST" ACTION="CallMe.php">
    <TABLE>
    
    <TR>
    Date:<BR>
    <TD><INPUT TYPE="TEXT" NAME="DATE" VALUE="<?php echo $DATE ?>"></TD>
    </TR>
    
    <TR>
    <TD ALIGN="CENTER">+</TD>
    </TR>
    
    <TR>
    <TD><INPUT TYPE="TEXT" NAME="OFFSET" VALUE="<?php echo $OFFSET ?>"></TD>
    </TR>
    
    <TR>
    <TD ALIGN="CENTER"><INPUT TYPE="SUBMIT" VALUE="="></TD>
    </TR>
    
    <TR>
    <TD><INPUT TYPE="TEXT" NAME="RESULT"
      VALUE="<?php echo date("M j, Y",(strtotime($DATE)+60*60*24*($OFFSET))) ?>" disabled></TD>
    </TR>
    
    </TABLE>
</FORM>
</BODY>
</HTML>




Post a reply
  Related Posts  to : Convert String to Date
 String to sql.Date     -  
 convert string into binary     -  
 convert string to lower case     -  
 Want start and end date of a month from current date     -  
 Formatting a Date with date()     -  
 check if string ends with specific sub-string in php     -  
 Splitting a String Based on a Found String     -  
 check if string start with a specific sub-string in PHP     -  
 recursive string reversal- reverse string     -  
 String token for string split     -  

Topic Tags

PHP Date, PHP Strings