Sign In | Subscribe

Enter your Sign on user name and password.

Forgot password?
  • Follow us on:
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of C#
  • Discussion

  • Study Guides

  • Table of Contents

Start Learning Now

Our free lessons will get you started (Adobe Flash® required).
Get immediate access to our entire library.

Sign up for

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Dates & Times

  • The DateTime data type is used to hold dates and times
  • .Now is used for the current date and time, .Today is for the current date and midnight time
  • You can use the String.Format or .ToString methods to format your dates and times
  • Some properties of DateTime:
    • .DayOfWeek
    • .Hour
    • .Month
    • .Millisecond
  • You can add or subtract dates and times like you would any other variable
  • .TotalMinutes and .TotalSeconds are other useful methods
  • Some useful methods of DateTime:
    • .AddDays
    • .AddYears
    • .AddSeconds
  • To subtract from DateTime, add a negative amount
  • TimeSpan allows you to give a generic timespan without reference to a specific day or time