Announcements
No record found.
Hi,
I am writing code unit for some business process.
I need to get time from datetime variable.
E.g. i have datetime "1/22/2020 5:00 AM", i need to get 5:00 AM and save it in a variable.
Thanks
Date := DT2DATE(Datetime)
DatetimeType: DateTime
The DateTime of which to return the date part.
Type: Date
The date part of the DateTime object.
try to use DT2Time Method
+ useful link: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-data-type
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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 1,682 Super User 2026 Season 1
YUN ZHU 1,010 Super User 2026 Season 1
Kamal Khakhkhar 495