Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6665813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:45:46+00:00 2026-05-26T02:45:46+00:00

Need a formula in excel and c# to convert data in yyyymmdd format to

  • 0

Need a formula in excel and c# to convert data in “yyyymmdd” format to julian date format “yyJJJ”? Where “JJJ” is the Julian date of day submitted. Is JJJ a number from 1 to 365 or 999 or 366? I don’t think its 366, but we do have leap year so it could be leap year.

In Excel I’m trying to use the following:

 =Year() & DAYS360("20110101","20110930")

In C# I’m using now() to get the current date. But I’m want the number of days between Jan 1st, and current date. Not sure if this is the correct prototype formula:

Prepend Two digit year format to the following
    Number of Days between "20110101" and "20110930" in "YY" format 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:45:47+00:00Added an answer on May 26, 2026 at 2:45 am

    Instead of handling this yourself in C#, you could simply use the JulianCalendar class

    And to get today in the Julian calendar, you could do:

    JulianCalendar calendar = new JulianCalendar();
    var today=DateTime.Today;
    var dateInJulian = calendar.ToDateTime(today.Year, today.Month, today.Day, today.Hour, today.Minute, today.Second, today.Millisecond);
    

    EDIT:

    And I realized I didn’t help you with a good way to get a result in the YYJJJ format you were looking for, it’s quite simple:

    var stringResult=string.Format("{0}{1}", dateInJulian.ToString("yy"), dateInJulian.DayOfYear);
    

    Sadly, I don’t think there’s an equivalent of dateTime.ToString("JJJ"); that will give the day of the year, hence my little string.Format() work-around, but it works just as well!

    EDIT2:

    So Phoog educated me a bit below in the comments, and pointed out that you weren’t looking for today in the Julian Calendar, which is what the above code would give in respect to the JulianCalendar class. Rather, it appears you’re looking for the Ordinal date (this piece added for future reader clarification). I’m going to leave the above so that someone doesn’t make the same mistake that I did. What you really want, I believe, is the code from the first edit but without the JulianCalendar business, so:

    var dateToConvert = DateTime.Today // Or any other date you want!
    var stringResult=string.Format("{0}{1}", dateToConvert.ToString("yy"), dateToConvert.DayOfYear);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel formula reading data from a column. The data in that
We need to create a custom formula for users to pull data from our
I need to convert dates into Excel serial numbers for a data munging script
Hi I'm using VBA in Excel and need to pass in the values from
I need to count unique values in range (C2:C2080) in excel. Googled formula: =SUM(IF(FREQUENCY(MATCH(C2:C2080;C2:C2080;0);MATCH(C2:C280;C2:C2080;0))>0;1))
Possible Duplicate: Populate unique values in to VBA array from excel I need to
I have text files from a data logger in a format like this hh:mm,
I'm trying to transfer data from a DataSet into an Excel workbook. Unfortunately, I
I need a formula that is beyond me and my Excel skills, I need
I need to convert a percentage to a scoring system in Excel 2003, either

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.