Is there a format value for DateTime.ToString("") that will specify the day of the year in three digits?
For example:
Terrestrial Time (TT) is a modern astronomical time standard defined by the International Astronomical Union, primarily for time-measurements of astronomical observations made from the surface of Earth.
The T is just a literal to separate the date from the time, and the Z means “zero hour offset” also known as “Zulu time” (UTC). If your strings always have a “Z” you can use: SimpleDateFormat format = new SimpleDateFormat( “yyyy-MM-dd'T'HH:mm:ss).
No, you can use DateTime.DayOfYear.ToString("000");
Your examples:
new DateTime(2012, 1, 1).DayOfYear.ToString("000");
new DateTime(2012, 2, 1).DayOfYear.ToString("000");
new DateTime(2012, 12, 31).DayOfYear.ToString("000");
new DateTime(2011, 12, 31).DayOfYear.ToString("000");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With