datetime data type cannot be changed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Ornstein

    #1

    datetime data type cannot be changed

    In other software, I could increment (or decrement) a datetime data
    item by minute, hour, day, month or year. This is helpful when
    tranversing special characters such as manufacturing calendars.

    But in the .Net Framwork, this is not available (I sure would like to
    know the reasoning behind this decision). For the moment, I would
    appreciate suggestions for work arounds.

    Thanks,

    - IanO -
  • Jon Skeet [C# MVP]

    #2
    Re: datetime data type cannot be changed

    Ian Ornstein <iano@infoave.n et> wrote:[color=blue]
    > In other software, I could increment (or decrement) a datetime data
    > item by minute, hour, day, month or year. This is helpful when
    > tranversing special characters such as manufacturing calendars.
    >
    > But in the .Net Framwork, this is not available (I sure would like to
    > know the reasoning behind this decision). For the moment, I would
    > appreciate suggestions for work arounds.[/color]

    Have a look at DateTime.AddDay s etc.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Frank Oquendo

      #3
      Re: datetime data type cannot be changed

      Ian Ornstein wrote:
      [color=blue]
      > But in the .Net Framwork, this is not available (I sure would like to
      > know the reasoning behind this decision). For the moment, I would
      > appreciate suggestions for work arounds.[/color]

      In addition to Jon's suggestion, the DateTime struct has overloaded the
      + and - operators so you can perform math with TimeSpan and DateTime
      objects.

      You might want to consult the help file for more details.

      --
      There are 10 kinds of people. Those who understand binary and those who
      don't.


      (Pull the pin to reply)


      Comment

      Working...