locked
showing a string (representing a date) with Date formatting RRS feed

  • Question

  • User379720387 posted

    How can I format a string (representing a date) as a date?

    This here works, but it seems overly complex.

    DateTime lessondt = ldate.AsDateTime();
    
    string lssndt1 = lessondt.ToString("dddd MMM dd");

    Friday, December 18, 2015 4:59 PM

Answers

  • User1853794821 posted

    try

    string strDesiredDate=(Request["theDate"].AsDateTime()).ToString("dddd MMM yy");

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 18, 2015 10:10 PM

All replies