get day of the month

  • Thread starter Thread starter poppy
  • Start date Start date
P

poppy

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

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

Is this what you are talking about?
- Brian
 
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!
***************************
 
DateTime types have a property Day returning an integer representing the day
of the month.

Gabriel Lozano-Morán
 
Back
Top