#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Norway
    Posts
    2
    Rep Power
    0

    Question how to get month in datetime field database


    how to get month in datatime field in database .
    i want to code in c#
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    486
    Rep Power
    11
    You want to extract the month of a datatime field ?

    I don't know exactly for c# but should be similar.
    in Vb.Net you do month(yourfield in date format) and you will get it. I hope it's help you solve your problem.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Brisbane, Australia
    Posts
    50
    Rep Power
    12
    this is how I get the month
    Code:
    int theMonth = ((System.DateTime)yourDateTimeFieldObject).Month;
    to get the month string like November, December etc...
    Code:
    int theMonth = ((System.DateTime)yourDateTimeFieldObject).ToString("MMMM");

IMN logo majestic logo threadwatch logo seochat tools logo