• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

DateTime question

Hi Experts,

How professionally to check if System.DateTime.Now is a first day of a month or not.

Thank you.
0
fpoyavo
Asked:
fpoyavo
  • 2
1 Solution
 
aacoolCommented:
For a System.DateTime value, the DateTime.Day property is the Day of the month. So,

if(System.DateTime.Now.Day == 1)
{
   // first day of month
}
else
{
   // not first day of month
}
0
 
aacoolCommented:
Day can have a value from 1 to 31
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now