rsd_17
rsd_17

Reputation: 75

How to put a number in data + time in Excel VBA

so I have numeric values ​​in a .log file that represent a date + time like "day / month / year hour: minutes: seconds" But by placing a number like this for example "1490569200,0" in an excel cell and converting the cell as time and even after customizing it to the format appears "############### " How can I solve this? I want to convert this number to a date and time

Upvotes: 0

Views: 59

Answers (1)

Gary's Student
Gary's Student

Reputation: 96753

Your date/time code appears to be a UNIX time code. It is the number of seconds elapsed from 1/1/1970. Placing your large value in A1, in B1 enter:

=ROUND(DATEVALUE("1/1/1970")+A1/(60*60*24),0)

Then format B1 as d/m/yyyy:

enter image description here

Upvotes: 1

Related Questions