Separate Date and Time

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,434
Hello All,

I have a huge amount of data that I need to separate dates and times from. It looks like this:

12/03/20 12:04:20 am +11:00
12/03/20 11:58:54 am +11:00
12/03/20 12:01:04 pm +11:00

How can I separate Dates and Times in dd/mm/yyyy and [h]:mm:ss formats respectively

Thanks for your help.

Asad
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I have used
Rich (BB code):
=LEFT(A2,SEARCH(" ",A2)-1)*1
to get the date and this is working fine.

I have used
Rich (BB code):
=MID(A2,SEARCH(" ",A2)+1,11)
as a first step to get the time and this also works fine but it is still text. If I then get rid of am and pm it makes all times after 12:00 as pm although a lot of them are am. I have unable to work out how can I get this done.
 
Upvote 0
with Power Query
DTDTDateTime
12/03/20 12:04:20 am +11:0012/03/2020 00:0412/03/202000:04:20
12/03/20 11:58:54 am +11:0012/03/2020 11:5812/03/202011:58:54
12/03/20 12:01:04 pm +11:0012/03/2020 12:0112/03/202012:01:04

Rich (BB code):
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"DT", type datetimezone}}),
    Date = Table.AddColumn(Type, "Date", each DateTime.Date([DT]), type date),
    Time = Table.AddColumn(Date, "Time", each DateTime.Time([DT]), type time)
in
    Time
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top