javascript Date() to MySQL datetime data type

Posted on 2006-04-20
Last Modified: 2008-01-16
I have one of those commonly used popup calendars on a page that is working fine.  It uses the following:

<input type="hidden" name="ticket_deadline_date" value="2006-04-28 00:00:00" />
<input type="text" name="deadline_date" value="04/28/06" class="text" readonly size="12"/>

I would like to change the values of both via a javascript function that will be triggered by a select option.  The "hidden" value is for writing to  MySQL with a data type of datetime.  The over form element is for display to the user.  I am pretty decent with javascript, but I don't know how to take "2006-04-20 00:00:00" and add 5 days to it, for example.  This would change the value to "2006-04-25 00:00:00"  and the other value to "04/25/06".

I haven't found a lot of flexibility in the javascript Date() object.  

Is this possible?
Question by:advlegals
    1 Comment
    LVL 35

    Accepted Solution

    Date functions emulated in Javascript

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now