Skip to main content

Notifications

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

  • Verified answer
    CDsilva Profile Picture
    4,188 on at
    RE: To convert integer to time

    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

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,316 Super User 2025 Season 1 on at
    RE: To convert integer to time

    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.

  • CDsilva Profile Picture
    4,188 on at
    RE: To convert integer to time

    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
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: To convert integer to time

    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)));

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,316 Super User 2025 Season 1 on at
    RE: To convert integer to time

    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.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans