Get the day of the year represented by the current DateTimeOffset object in CSharp
Description
The following code shows how to get the day of the year represented by the current DateTimeOffset object.
Example
using System;//from ww w . ja v a 2 s . c o m
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.