Downloads
Power Query MDate and timeIntermediate

DateTime.From

Converts a value, such as a date, a time zone value or text, to a date and time.

Syntax
DateTime.From(value as any, optional culture as nullable text) as nullable datetime

Returns: The date and time, or null when the input is null.

What it does

DateTime.From turns a value into a date with a time of day. It is most useful for a date that needs a time added, or for a time zone value that must be shown as a plain local date and time. Use it when the time matters, such as the timestamp of a payment or the approval time of a journal. When only the date matters, Date.From is simpler.

Syntax and arguments

Example

An accounts payable team wants the approval time of an invoice next to the date, so it can see whether approvals were made the same day as the invoice. The date is converted to a datetime at midnight, which is the usual base for a comparison.

let
    Approvals = #table(type table [Invoice = text, ApprovedOn = date],
        {{"INV1043", #date(2026, 10, 27)}, {"INV1044", #date(2026, 10, 29)}}),
    WithTime = Table.AddColumn(Approvals, "ApprovedAt", each DateTime.From([ApprovedOn]), type datetime)
in
    WithTime

INV1043 gets the timestamp October 27, 2026 at 00:00:00 and INV1044 gets October 29, 2026 at 00:00:00. A real approval time would come from the source system as a datetime, and it would replace this midnight value.

Example: a second, different use

Turn a date and time from a bank file into a single datetime column, for a payment that carries a separate date and time column.

Things to watch

In business terms

Audit trails, cut-off testing and approval timing all depend on exact timestamps. Keeping the time with the date, and knowing where it came from, is what lets an auditor test whether an entry was posted before the period closed.

Related functions

All Power Query M functions · View as Markdown · M basics