2
Answers

String Format

Ask a question
Brian

Brian

15y
3.6k
1
I am getting my date from database. I have declared a string dictionary to parse my date by string format. when i call my date is showing like 30/00/09.
here is the part of my  code
if (Order[i].ShipDate  > DateTime.Now)
{
                      
      XRecord.Add("SHIPDATE",  String.Format("0:yy/mm/dd",Order[i].ShipDate));
 }

 if (XRecord.Count > 0)
                    {
                        //OrderExport.AppendFormat("X,W{0:MM}{1:00000}",    Order[i].OrderDate, Order[i].OrderNum % 100000);
                       OrderExport.Append(string.Format("X,W{0:MM}{1:00000}", Order[i].OrderDate, Order[i].OrderNum % 100000).ToUpper());
                        foreach (KeyValuePair<string, string> entry in XRecord)
                        {
                            OrderExport.Append(string.Format(",{0},{1}", entry.Key, entry.Value).ToUpper());
                        }
                        OrderExport.AppendLine();
                    }
please help


Answers (2)