Concatenate Date and Time

I’m trying to combine two columns: a date and a time, into a single column with a datetime.

Column A is formatted as a Date
Column B is formatted as a Time

But how do I combine them?!?

  • “concat” does not work.
  • Adding them together does not work.
  • Converting to text and concatenating does not work.

How can I do this (what should be insanely simple) operation?!

If these data are NUMERIC values really, then just add the time to the date value. DateTime values are decimal fraction numbers: the date is the integer part of the number (the elapsed days since the base date), and the fraction is the Time: 0,5 = 12:00

Can you upload an ODF type sample file here?

Only because the format strings in the TEXT functions use curly double quotes, instead of straight double quotes, as used in the intermediate space in the formula.

2 Likes

Based on the second row of the image, i suppose that you have use real numeric dates and time values, but they are DateTime values really, (the date is a DateTime value with non-zero fraction part, and the “time” is a DateTime value really with non-zero integer part), therefore the adding results false DateTime.

3 Likes

Hallo

=TEXT( A2+B2 ; "YYYY-MM-DD HH:MM:SS" )

ps. from your screenshot it looks like both Columns contains the same full Date&Time-Stamp but A shows only the DatePart (by Formatting) and B shows only the TimePart (by Formatting… so your Formula should simply:

=TEXT( A2 ; "YYYY-MM-DD HH:MM:SS" )
#doesnt matter if you use B2 instead!
3 Likes