Jump to content

Manipulating Strings as Dates


Seb Spiers

Recommended Posts

Hi There,

Ive got a simple html form with a text field in which a date is entered in a dd/mm/yyyy format.
I want to be able to manipulte the date by adding and subtracting days.

The problem i've found is that if I enter 22/06/1983 and for example do; [code]<? echo ( $date_commencing + 6 ) ; ?>[/code]The output is not 28/06/1983, it simply outputs "28".  It uses the numbers before the first "/".  I want to handle the date as a date.

Can anyone help? :)

Ta! :X
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.