C# DateTimeOffset DayOfYear

Description

DateTimeOffset DayOfYear gets the day of the year represented by the current DateTimeOffset object.

Syntax

DateTimeOffset.DayOfYear has the following syntax.


public int DayOfYear { get; }

Example


using System;// w  ww  .j a v a2  s .  com

public class MainClass{
  public static void Main(String[] argv){  
    DateTimeOffset startOfMonth = new DateTimeOffset(2014, 1, 1, 0, 0, 0, 
                                             DateTimeOffset.Now.Offset);
    Console.WriteLine(startOfMonth.DayOfYear);

  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version