Discussion


I also wanted to direct you to Microsoft's documentation for formatting strings with C#/.Net:

Basically, you can alter/replace "String.Format()" with the available options:

I'd recommend that you copy the TicksAsRFC1123() function, rename it, and play with the format options.

   public string  TicksAsRFC1123(long  ticks)
   {
     string    result;
     DateTime  dateTime;

     dateTime = new DateTime(ticks);
     result = String.Format("{0:r}", dateTime);

     return result;
   }

   public string  TicksAsMyFormat(long  ticks)
   {
     string    result;
     DateTime  dateTime;

     dateTime = new DateTime(ticks);
     result = String.Format("{0:d}", dateTime);

     return result;
   }

-- BenAllums

To add to Ben's note, if you use:

   public string  TicksAsMyFormat(long  ticks)
   {
     string    result;
     DateTime  dateTime;

     dateTime = new DateTime(ticks);
     result = String.Format("{0:d}", dateTime);

     return result;

note specifically the {0:d}, your date format will simply be mm/dd/yyyy. The "d", rather than the "r" makes the difference.

-- Marsha Lofthouse

DevCenter/Projects/MetaTags/Discussion (last edited 2009-06-29 18:07:01 by MarshaLofthouse)