Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

long a = DateTime.Now.Ticks;

DateTime.Now.AddMinutes(15);

long b = DateTime.Now.Ticks;

 

Following example shows that a and b have same value. Instead I have expected that b would have 15 minuttes more than a.

 

How do I make it that way ?

Posted

AddMinutes returns a date time. Fo b to have a + 15 minute you would have to make a statement like

 

DateTime b = DateTime.Now.AddMinutes(15);

 

or something very simliar to that. Read the documentation a little bit more on that method.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...