3 Replies - 734 Views - Last Post: 29 March 2013 - 07:12 AM Rate Topic: -----

#1 Robh85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-May 12

How to get the day of the month as an int

Posted 29 March 2013 - 06:01 AM

Hi am trying to write a program that checks for thinks at certain days in month how can i get the day in month as int as in todays date i would want it to display 29 i know its easy problem but look on the net and can't find anything to just display the date as int If anyone can help cheers
Is This A Good Question/Topic? 0
  • +

Replies To: How to get the day of the month as an int

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3190
  • View blog
  • Posts: 10,681
  • Joined: 12-December 12

Re: How to get the day of the month as an int

Posted 29 March 2013 - 06:30 AM

        Dim todayDay As Integer = DateTime.Now.ToLocalTime.Day
        MessageBox.Show(todayDay.ToString)


or just

Dim todayDay As Integer = DateTime.Now.Day

Was This Post Helpful? 2
  • +
  • -

#3 Robh85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-May 12

Re: How to get the day of the month as an int

Posted 29 March 2013 - 06:57 AM

Ya that work great thanks alot
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3190
  • View blog
  • Posts: 10,681
  • Joined: 12-December 12

Re: How to get the day of the month as an int

Posted 29 March 2013 - 07:12 AM

No worries.

Hint: If you might look at the month (or year etc.) as well then it is best to obtain the date once and store it in a variable:

Dim today As DateTime = DateTime.Now
dim todayDay As Integer = today.Day

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1