Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Forcing a DateTime's *Time* Value to a Static Value Using Workflow

Posted on by

Does anyone know a way to set the *time* part of a DateTime using Workflow? I have a DateTime and I want to keep the date part, but force the time to a static value.

The use case here is that I am setting up a follow-up time by adding one day to the Process Execution Time, but I want the value to show up in the AM timeframe.

For example if the DateTime is 11/2/2015 15:31, I want to convert it to 11/2/2015 08:00.

I have not found any plugins that do this either, including the otherwise excellent CRM DateTime Workflow Utilities.

If I have to code a custom workflow activity I will, but I find this one to be elementary and I'm surprised there are no OOTB or widely available plugins that will solve the problem.

TIA

*This post is locked for comments

  • Suggested answer
    Yash740 Profile Picture
    Yash740 5 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    Hi, 

    Sorry for the delayed post but I hope someone would get benefits out of this answer.

    pastedimage1599544013843v1.png Select the hours as per your need and set either Before or After based on the req. And then after selecting the field to be mapped, click on add and then ok. This should set only the time portion of the Date Time field on the form. Hope it helps someone. 

    Thanks,

    Yashawanth K S

  • Verified answer
    PS Profile Picture
    PS 23,577 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    Its not possible via workflows

  • Bob Hatcher Profile Picture
    Bob Hatcher on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    As I noted in my description and topic title, I am trying to do this with workflow.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    Hi,

    Please go through the link below. I think this will helps you.

    http://www.textndata.com/forums/set-default-time-datetime-field-437997.html

    Thanks

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    social.microsoft.com/.../how-to-set-default-value-for-time-in-date-and-time-field

    check this if it helps

  • Bob Hatcher Profile Picture
    Bob Hatcher on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    No.

    Say I have a DateTIme value on an individual record, new_dt. It is 1/1/2016 12:00.

    I want to run the workflow on that one record.

    And I want the output of the workflow to be such that new_dt = 1/1/2016 08:00. I want the TIME part to *always* be 08:00 and the DATE portion to be unchanged.

  • PS Profile Picture
    PS 23,577 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    You want this for all records right?

    What's the static value you want to set, is it 02:00AM for all records?

  • Bob Hatcher Profile Picture
    Bob Hatcher on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    No. I want to use workflow to set the TIME portion of a DateTime value only.

    If the DateTime is 7/1/2015 09:00, I want to force the time to a static value.

    7/1/2015 09:00 --> Apply Workflow --> 7/1/2015 02:00

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    Go to settings>>Administration>>system Settings>>Formats>>Customize>>Time>>Select small letter h:m

    0652.1.PNG

  • PS Profile Picture
    PS 23,577 on at
    RE: Forcing a DateTime's *Time* Value to a Static Value Using Workflow

    What I understand from your question is that, you want to see time in 12 hour format and not 24 hour format. for e.g. 8: 00 AM or 8:00 PM are 12 hour format but 15:00PM is 24 hour format.

    Am i correct?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans