This tutorial explains how to implement to get a JavaScript date object from user selected date time & timezone and the date object can be sent server side to save or for further processing. HTML5 provides input type datetime-local
allows user to enter both a date and a time and the user’s local time zone is used. For simplicity, Let’s enhance this to allow user to select any timezone. We are going to use Moment-Timezone library.
Tag: datetime
String to DateTime, FormatException and ASP.NET
There are lots of bugs/errors due to improper handling of datetime. Sometime we don’t know the production server regional settings or the culture information. It may different from the development area. Thus this yields the errors on deployment if not handled properly. See one example:
Convert TimeSpan to year, month, date (Age Calculation) in .NET
Generally, it is required to express Datetime difference in terms of year, month or day format. Basic example of this is the Age calculation. In .NET Date difference is expressed in timespan. If you require age only in Year then