Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
then I suggest looking first at the various Transform functions available in the step.
I think I covered all test cases, but I am extremely new to Java Script, so this code might have bugs. I did this because as far as I know HTML5 date is a string.When setting a date, without specifying the time zone, Java Script will use the browser's time zone.When getting a date, without specifying the time zone, the result is converted to the browser's time zone.There are no required external dependencies at all!Though for the datetime and date validator to you need to specify a parse and format function and for that you most likely will want to use a library, is highly recommended.In other words: If a date/time is created in GMT (Greenwich Mean Time), the date/time will be converted to CDT (Central US Daylight Time) if a user browses from central US.