Whenever writing the date-and-time to an excel sheet the default cell format treats it as date and time and display in the format dd/mm/yyyy hh:mm, rather than displaying as dd-MMM-yyyy HH:mm:ss
But coming back to an Excel Sheet, whenever the date and time is enclosed with " "(double quotes) and prefixed with =(equals sign), it treats it as a string holding some values and displays exactly as it is rather than displaying default dd/mm/yyyy hh:mm format.
So as per the requirement, to achieve the string containing table data having dd/mm/yyyy hh:mm format need's to replace the date and time enclosed with double quotes with ="dd-MMM-yyyy HH:mm:ss"
Eg: 25-Feb-2020 15:27:58 need to be replaced with ="25-Feb-2020 15:27:58"
- \n
"\"> class=\"th-inner \">Login Nameclass=\"fht-cell\">"\"> class=\"th-inner sortable\">Registeredclass=\"fht-cell\">"\"> class=\"th-inner \">Registered Date
Timeclass=\"fht-cell\">"\"> class=\"th-inner sortable\">User Response Countclass=\"fht-cell\">"\"> class=\"th-inner \">Test Start Date Timeclass=\"fht-cell\">"\"> class=\"th-inner \">Test End Date Timeclass=\"fht-cell\">"\"> class=\"th-inner \">Time Remainingclass=\"fht-cell\">"\"> class=\"th-inner \">User Statusclass=\"fht-cell\">"9\"> "\">njuser14 "\">Yes "\">- "\">0 "\">25-Feb-2020 15:27:58 "\">25-Feb-2020 15:28:03 "\">179 "\">Paused "10\"> "\">njuser15 "\">Yes "\">- "\">0 "\">25-Feb-2020 15:27:32 "\">25-Feb-2020 15:27:42 "\">179 "\">Paused
In the below coding snippets BatchDetails holding string containing table data, needs to be replaced and later assigned into session
- [System.Web.Services.WebMethod()]
- public static string PersistBatchDetails(object BatchDetails)
- {
- try
- {
- HttpContext.Current.Session["DashboardBatchInfo"] = BatchDetails;
- }
- catch (Exception ex){}
- return "S001";
- }

Nishanth JPosted Apr 5, 2020, 11:53 AM
Time