how to convert a decimal number in excel to date and time

With a have excel column with number like 1417528069
These number are actually represent date and time in an sybase table column.
how can these numbers be converted to date and time.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hakan YılmazTechnical Office MEP EngineerCommented:
Normally, dates in excel are decimals, but they are smaller numbers.
The decimal Zero is 0.01.1900 with default settings.
Counting days from this date, 02.03.2015 is represented by 42065.
And 42065,875 means, 02.03.2015 + 0,875 day = 02.03.2015 21:00.
barry houdiniCommented:
Hello Rickgov,

Do you know which date/time values those convert to?

What do you want 1417528069 to convert to? What about 1417544959?

I don't know how to convert those......but if you can give some sample conversions it should be possible to use an excel formula to replicate that

regards, barry
Danny ChildIT ManagerCommented:
I don't see how  the numbers above represent dates, I would have anticipated something along the lines of
yyyymmddThhmm as a possible sybase format.

Can you explain further please, preferably giving some examples?

then, we can get Excel to do the translation for you, on an ongoing basis...

Generally, using Excel's LEFT, MID and RIGHT functions lets you pull out certain characters from a string of a pre-defined format (for example characters 5 and 6 could give a 2-digit month code).

You can then use these with the CONCATENATE or & functions to build date strings

Cell A1 = 20150228 - which would mean the 28th Feb '15
Cell B1 = =RIGHT(A1,2)&"/"&MID(A1,5,2)&"/"&LEFT(A1,4)
and this cell would then return 28/02/2015 - which is a valid excel date format
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Tony PittCommented:
I believe Sybase stores dates based on 1753.  Therefore these numbers will be something like number of days since 1 Jan 1753, but we need to know what certain integers represent to be able to work out exactly what.

barry houdiniCommented:
Actually, looking again, those look like Unix timestamps, i.e. the number of seconds since 1/1/1970. If that's the case then with the timestamp in A2 use this formula to convert in B2


Format B2 to show date and time, e.g. with custom format d-mmm-yyyy hh:mm:ss or similar

1417528069 converts to 2-Dec-2014 13:47:49

regards, barry

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tony PittCommented:
Sybase supports the DATETIME and SMALLDATETIME values. A DATETIME can have a value from Jan 1 1753 to Dec 31, 9999 with a 300th of a second resolution. A SMALLDATETIME has a range of Jan 1 1900 to Jun 6 2079 with a 1 minute resolution... at least according to something that I found on the Internet.

However, these are still rather odd values, I think.

ShenAuthor Commented:
I tried the formula=DATE(1970,1,1)+A2/86400 and the format d-mmm-yyyy hh:mm:ss and is close.

We have a record with 1425320708 that should output: 2-Mar-2015 1:25:08 PM. However, when i run the formula and the format it outputs: 2-Mar-2015 06:25:08  PM.  It has the gmt  5 hours difference. Is there any away to adjust the formula to display local time
ShenAuthor Commented:
it iseens to be okay now. i subtract form the formula time(5,0,0).
ShenAuthor Commented:
thanks for the help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.