Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Date Conversion

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
I have dates, e.g. ,12/13/1985, which I must convert into a 5 digit number.  Is there a format for which this can be done. A Julian date gives me 7 digits plus the fractional hours and minutes. However, I need five digits. Please don't ask why.
Question by:gbm33
  • 3
  • 2
  • 2
  • +1

Expert Comment

ID: 35725962
You could write it in hex decimal

year = 3
2010 = 7da  

month = 1
12 = c

day =1 or 2
1 = 1
31 = 1f

2010 12 1 = 7dac1
2010 12 31 = 7dac1f

Author Comment

ID: 35727924
babesia: Thank you for the suggestion. However, I must have digits, i.e., numerical only, not alpha--numeric.

Accepted Solution

Orcbighter earned 1000 total points
ID: 35729042
format DDDYY where DDD is Julian day (1 to 365) and YY id last 2 digits of year.
If YY < 20 then year = 20YY else year = 19YY
January 27 2011 = 02711;
January 27 2010 = 02710;
January 27 1978 = 02778;  
November 27 2010 = 33110
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.


Author Comment

ID: 35729880
Orcbighter: Indeed, your way is a way to concoct 5 digits from a date.  However, this is not the solution I will need. I think I need something that is a standard way like creating 7 digits with a Julian conversion.

Expert Comment

ID: 35737431
Hi gbm33,
The solution I gave you is a standard way for deriving a 5-digit date, with the proviso you have to have agreed on your start point in order to determine the century. I am not aware of any other.
The old standard was ddmmyy, giving six digits and sparking the whole Y2K problem. The new standard is ddmmyyyy, giving seven digits (good until the year 9999 AD).
If you want 5 digits, this is it, I think
LVL 41

Assisted Solution

ralmada earned 1000 total points
ID: 35756522
you can get the numbers of days from 1-1-1900 to 12/13/1985, that will give you 31394

LVL 41

Expert Comment

ID: 35758115
Well, I have to object this. I did provided you with exactly what you asked for: a way to represent a date in a 5 digit format, which by the way is just like Excel would do it. So I don't understand why this disposition.

Author Closing Comment

ID: 35758180
These answers did not give me the information I needed but they both indeed do give a five digit number.

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question