datetime object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elenda
    New Member
    • Oct 2007
    • 1

    #1

    datetime object

    I am attempting to use the datetime object to determine how many days until Christmas day. I have to use the Now method. Any suggestions?
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Originally posted by Elenda
    I am attempting to use the datetime object to determine how many days until Christmas day. I have to use the Now method. Any suggestions?
    DateTime.Now will give the current system date time

    create a new datetime with the values of the date of christmas

    and subtract datetime.now from the christmas object to get a timespan
    and timespan.days will gve you the number of days

    cheers

    Comment

    Working...