Skip to content

Proper way to build a DateTime from another DateTime's Date #1508

@xguerin

Description

@xguerin

Hello,

I have a use case where I need to build a DateTime from Local::now() using its Date component and some future Time, respecting the timezone. This is trivially done using DateTime::date(), but this function has been deprecated. What would be the recommended way to do this (date_naive() does not work here as it's stripped of the original timezone).

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions