Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
TonyHansson
Frequent Visitor

Change date and time

Hi

 

I have a column with a date and time.

 

I need to keep the date, but change the time to always be 15:00

 

I have tried different but no luck.

 

Custom column = Date.From([#"Column"]) + #duration(0,15,0,0)

 

Regards

 

Tony

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

You could try constructing a datetime and hardcoding the time .

Here's a start:

#datetime(Date.Year([Column1]), Date.Month([Column1].....

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

You could also use DateTime.ToText and DateTime.FromText like this:

DateTime.FromText(DateTime.ToText([Column], [Format="yyyy-MM-dd 15:00:00"]))

 

TonyHansson
Frequent Visitor

Hi @HotChilli 

 

Worked perfect Thank you

 

#datetime(Date.Year([#"M&P deadline"]),Date.Month([#"M&P deadline"]),Date.Day([#"M&P deadline"]),15,00,00)

HotChilli
Super User
Super User

You could try constructing a datetime and hardcoding the time .

Here's a start:

#datetime(Date.Year([Column1]), Date.Month([Column1].....

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.