Given a date string in EST, output the given date as a string with 12 hours added to the time.
Time zone should be preserved.
Example input:
"March 7 2009 7:30pm EST"
Example output:
"March 8 2009 7:30am EST"
add12Hours
is a function.
testString: assert(typeof add12Hours === 'function', 'add12Hours
is a function.');
- text: add12Hours(dateString)
should return a string.
testString: assert(typeof add12Hours('January 17 2017 11:43am EST') === 'string', 'add12Hours(dateString)
should return a string.');
- text: add12Hours("January 17 2017 11:43am EST")
should return "January 17 2017 11:43pm EST"
testString: assert(add12Hours('January 17 2017 11:43am EST') === 'January 17 2017 11:43pm EST', 'add12Hours("January 17 2017 11:43am EST")
should return "January 17 2017 11:43pm EST"
');
- text: Should handel day change. add12Hours("March 7 2009 7:30pm EST")
should return "March 8 2009 7:30am EST"
testString: assert(add12Hours('March 7 2009 7:30pm EST') === 'March 8 2009 7:30am EST', 'Should handel day change. add12Hours("March 7 2009 7:30pm EST")
should return "March 8 2009 7:30am EST"
');
- text: Should handel month change in a leap years. add12Hours("February 29 2004 9:15pm EST")
should return "March 1 2004 9:15am EST"
testString: assert(add12Hours('February 29 2004 9:15pm EST') === 'March 1 2004 9:15am EST', 'Should handel month change in a leap years. add12Hours("February 29 2004 9:15pm EST")
should return "March 1 2004 9:15am EST"
');
- text: Should handel month change in a common years. add12Hours("February 28 1999 3:15pm EST")
should return "March 1 1999 3:15am EST"
testString: assert(add12Hours('February 28 1999 3:15pm EST') === 'March 1 1999 3:15am EST', 'Should handel month change in a common years. add12Hours("February 28 1999 3:15pm EST")
should return "March 1 1999 3:15am EST"
');
- text: Should handel year change. add12Hours("December 31 2020 1:45pm EST")
should return "January 1 2021 1:45am EST"
testString: assert(add12Hours('December 31 2020 1:45pm EST') === 'January 1 2021 1:45am EST', 'Should handel year change. add12Hours("December 31 2020 1:45pm EST")
should return "January 1 2021 1:45am EST"
');
```