SgDotNet
Singapore Professional .NET User Group -For Cool Developers

C# datetime

Latest post 03-14-2006 2:26 PM by ppa. 1 replies.
  • 03-14-2006 12:44 PM

    C# datetime

    Greetings All,

     

    in the following code am using Microsoft.VisualBasic in my C# program. with out using Microsoft.VisualBasic can any one help me to give the complete equvalent code in C#

     

    Microsoft.VisualBasic.FirstDayOfWeek z1 = 0;

    DateTime dt1= DateTime.Now;

    string strDayName =      DateAndTime.WeekdayName(DateAndTime.Weekday(dt1,z1),false,z1).ToString();

     

    Thanks

    Tec

  • 03-14-2006 2:26 PM In reply to

    • ppa
    • Not Ranked
    • Joined on 01-04-2006
    • Posts 1

    Re: C# datetime

    Hope the following is helpful.

    ------------------

    strDayName = DateTime.Now.DayOfWeek.ToString();

    or

    DateTime dt1 = DateTime.Now;

    strDayName = dt1.DayOfWeek.ToString();

    ------------------

    PPA

Page 1 of 1 (2 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems