Velocity Reviews > get day of the month

# get day of the month

poppy
Guest
Posts: n/a

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

TIA

Brian Patterson
Guest
Posts: n/a

 04-25-2005
string dateString = "10/7/1973";
DateTime dt = DateTime.Parse(dateString);
int day = dt.Day;

Is this what you are talking about?
- Brian
"poppy" <(E-Mail Removed)> wrote in message
news:1f6301c549a8\$1a57c420\$(E-Mail Removed)...
> Does anyone know how I can get an integer from a date
> representing the day of the month ?
>
> TIA

Lucas Tam
Guest
Posts: n/a

 04-25-2005
"poppy" <(E-Mail Removed)> wrote in news:1f6301c549a8
\$1a57c420\$(E-Mail Removed):

> 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 ((E-Mail Removed))

=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBNVlA=?=
Guest
Posts: n/a

 04-25-2005
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
>

Gabriel Lozano-Morán
Guest
Posts: n/a

 04-25-2005
DateTime types have a property Day returning an integer representing the day
of the month.

Gabriel Lozano-Morán

"poppy" <(E-Mail Removed)> wrote in message
news:1f6301c549a8\$1a57c420\$(E-Mail Removed)...
> Does anyone know how I can get an integer from a date
> representing the day of the month ?
>
> TIA