get day of the month

Discussion in 'ASP .Net' started by poppy, Apr 25, 2005.

  1. poppy

    poppy Guest

    Does anyone know how I can get an integer from a date
    representing the day of the month ?

    TIA
     
    poppy, Apr 25, 2005
    #1
    1. Advertising

  2. string dateString = "10/7/1973";
    DateTime dt = DateTime.Parse(dateString);
    int day = dt.Day;

    Is this what you are talking about?
    - Brian
    "poppy" <> wrote in message
    news:1f6301c549a8$1a57c420$...
    > Does anyone know how I can get an integer from a date
    > representing the day of the month ?
    >
    > TIA
     
    Brian Patterson, Apr 25, 2005
    #2
    1. Advertising

  3. poppy

    Lucas Tam Guest

    "poppy" <> wrote in news:1f6301c549a8
    $1a57c420$:

    > Does anyone know how I can get an integer from a date
    > representing the day of the month ?



    Day() or Weekday() - depending on what you want : )




    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
     
    Lucas Tam, Apr 25, 2005
    #3
  4. Put the date in a DateTime structure and pull the day.

    DateTime dt = DateTime.Parse(dateString);
    int day = dt.Day;

    ---

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************
    "poppy" wrote:

    > Does anyone know how I can get an integer from a date
    > representing the day of the month ?
    >
    > TIA
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Apr 25, 2005
    #4
  5. DateTime types have a property Day returning an integer representing the day
    of the month.

    Gabriel Lozano-Morán

    "poppy" <> wrote in message
    news:1f6301c549a8$1a57c420$...
    > Does anyone know how I can get an integer from a date
    > representing the day of the month ?
    >
    > TIA
     
    Gabriel Lozano-Morán, Apr 25, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michal Maciejczak
    Replies:
    1
    Views:
    1,998
    Matthias Kaeppler
    Apr 23, 2005
  2. Replies:
    1
    Views:
    466
    Steve W. Jackson
    Dec 22, 2006
  3. Replies:
    1
    Views:
    428
    Pavel Lepin
    Jul 30, 2007
  4. Andy
    Replies:
    1
    Views:
    736
  5. Rob Redmon

    Convert day of year to month, day

    Rob Redmon, Apr 4, 2008, in forum: Ruby
    Replies:
    7
    Views:
    314
    Alex Wayne
    Apr 4, 2008
Loading...

Share This Page