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 sjsj2732, Yesterday, 04:31 AM
            0 responses
            39 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            290 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            289 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            135 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            96 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X