I am using asp.net/c# to build an application.I am accepting dates in British Format .
Suppose a user enters a date in the format 02/04/2001 , it gets stored in the table properly.However when i retrieve it the date is coming in this format 4/2/2001. I know that is coming in American Format , that’s ok for me , my issue is that it is removing 0'sfrom numbers which are single digit. Will i have to check for such numbers and padding a zero before it and then display dates.Is there any way for this.
Thanks
I am using asp.net/c# to build an application.I am accepting dates in British Format
Share
You can format a date retrieved from SQL Server in .Net without worrying about the underlying value. Use culture-specific formatting if desired.
Standard Date and Time Format Strings
Custom Date Time Formats in .Net
Formatting Date and Time for a Specific Culture
Just to be clear (per Damien’s comment) I am making the assumption that you are storing your values as
Dates,DateTimes,DateTime2s, etc. in SQL not as strings. If that’s not the case, conversion to a proper type should be the first step.