Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    May 28, 2014 @ 12:13
    Fuji Kusaka
    0

    DateTime

    Hi Guys,

    How do i get to use DateTime where i want to add Days to it.

    Basically i would like to add 2 days to my today date.

    How can i make use of

    DateTime today = DateTime.Now.ToShortDateString();
    DateTime comingDay = today.AddDays(2);
  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    May 28, 2014 @ 12:16
    Jeavon Leopold
    0

    What do you want to use it for?

    Your snippet is not quite right, it should be like this:

    DateTime today = DateTime.Now;
    DateTime comingDay = today.AddDays(2);
    
  • Fuji Kusaka 2203 posts 4220 karma points
    May 28, 2014 @ 12:18
    Fuji Kusaka
    0

    Nevermind got it working

    var today = DateTime.Now.ToShortDateString();
    var comingDay = DateTime.Now.AddDays(2).ToShortDateString();
  • Fuji Kusaka 2203 posts 4220 karma points
    May 28, 2014 @ 12:33
    Fuji Kusaka
    0

    Hi Jeavon,

    Sorry i didnt see you reply before posting. But thanks for the tip. 

    Its only for a count down in js.

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    May 28, 2014 @ 12:34
    Jeavon Leopold
    0

    Np, glad it's working now!

  • Fuji Kusaka 2203 posts 4220 karma points
    May 29, 2014 @ 11:25
    Fuji Kusaka
    0

    Yep :) 

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies