Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

first day and last day of each month

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    first day and last day of each month

    hello,

    I would like to know the first day and last day of each month.
    For the week, the role exists, DayOfWeek.
    Is there a way of knowing this for months.

    thank you

    #2
    Not sure what you mean. Just run the DateTime with a date of 9/1 for instance and then use .DayOfWeek on it and it will give you the day it is.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I'll take an example.
      I must make a DrawDot, one early and one at the end of each month.
      How to detect the first day and last jor each month.

      Comment


        #4
        Just check the dates. If the date is 1 or 30/31 then it is beginning/end of month
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          ... 30/31 is near at the truth already. The save way to find the last day of this month should go like this:

          DateTime LastOfSep2009 = new DateTime(2009, 10, 1).AddDays(-1);

          Regards
          Ralph

          Comment


            #6
            yes,
            thank you very much

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            164 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            317 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            245 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            179 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X