web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

To convert integer to time

(0) ShareShare
ReportReport
Posted on by 4,188

Hi All,

I've converted my time to e.g 11:40:53 to integer variable Hour=11 then Minutes:40 seconds:53 now my question is how to convert the Integer variables to time ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi,

    If you know you parameters of time like -

    1. Hours.

    2. Minutes.

    3. Seconds.

    then you can use  EVALUATE(MyTime,'114053');

    ** Where MyTime is a Time Variable. 

    The System will save value in MyTime variable as - 11:40:53 AM

    ** For NAV it's a 24-hour clock.

    Let me know if any questions.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    There's no a direct conversion. You need to create a custom function that performs what you want.

    From an integer you can obtain a TIMe in this way:

    message(format(000000T + (YOURINT * 10000)));

  • CDsilva Profile Picture
    4,188 on at

    Hi Saurav,

    Thanks,

    I tried EVALAUTE(TimeVar,Hours),

    This works perfectly. But I'm not able to evaluate Minutes and seconds.

    Any suggestion on this?

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,380 Super User 2025 Season 2 on at

    Hi,

    In the example above if you use - EVALUATE(MyTime,'114053');

    That means 11 hours, 40 minutes and 53 seconds.

    Try this evaluate statement and let me know how it works.

  • Verified answer
    CDsilva Profile Picture
    4,188 on at

    I've resolved my issue. I've written a blog on it

    chrisdsilvablog.wordpress.com/.../how-to-restrict-an-action-button-based-on-time-in-microsoft-dynamics-nav

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans