Solved

DateTime question

Posted on 2004-10-22
199 Views
Last Modified: 2010-04-15
Hi Experts,

How professionally to check if System.DateTime.Now is a first day of a month or not.

Thank you.
0
Question by:fpoyavo
    2 Comments
     
    LVL 3

    Accepted Solution

    by:
    For a System.DateTime value, the DateTime.Day property is the Day of the month. So,

    if(System.DateTime.Now.Day == 1)
    {
       // first day of month
    }
    else
    {
       // not first day of month
    }
    0
     
    LVL 3

    Expert Comment

    by:aacool
    Day can have a value from 1 to 31
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now