'Get datetime with input mask?

I have an input that by default shows the date in a lengthy fashion:

"Tue Aug 18 2009 15:06:36 GMT-0500 (Central Daylight Time)"

and I'm tasked to use the inputmask (https://github.com/RobinHerbots/jquery.inputmask) plug in to format this to mm/dd/yy hh:mm. I've read over the documentation for the plugin, but I see nothing about implementing the extensions

"jquery.inputmask.date.extensions.js Auto-completion of time hours, minutes & seconds in date extension #570"

Any idea how to format my input field with the date AND time? Thanks in advance.

HTML:

<input type='text' value='Tue Aug 18 2009 15:06:36 GMT-0500 (Central Daylight Time)' />

jQuery:

$('input[type=text]').inputmask("mm/dd/yyyy");

Can't get the plugin to work on the fiddle. http://jsfiddle.net/vD25C/



Solution 1:[1]

it works!

you didn't configure your fiddle correctly. First of all you didn't add jQuery to the page. Also to get your code working you have to add somehow inputmask plugin to the page. It's possible to do using "External Resources" options or you can add the plugin's source to the page directly. Because I did't find any good URL for the plugin, I used the second options and just added the code to the scrips section. After all these manipulations is works now and you can use the code $('input[type=text]').inputmask("mm/dd/yyyy"); to get the result that you want. Here is updated fiddle.

UPDATE

to get DATE AND TIME you can use this one:

$('input[type=text]').inputmask("datetime");

updates fiddle here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1