Delphi/Lazarus: Convert Year, Month and Day to DateTime-Format
Question by Guest | 2015-12-02 at 17:42
I have an individual integer variable for year, month and day. I would like to create a date in the TDateTime format out of this values and convert them accordingly.
Is this possible using Delphi or Lazarus?
Related Topics
MySQL: Group Timestamp Column by Month and Year
Tip | 0 Comments
Delphi/Lazarus: Display current Date and Time
Tip | 0 Comments
PHP: Current Date and Time
Tutorial | 0 Comments
JavaScript: Get current Date and Time
Tutorial | 1 Comment
Convert many CSV Files to XLSX or ODS Spreadsheets
Tutorial | 0 Comments
Delphi/Lazarus: 3 Ways to round a Number to X Decimal Places
Tutorial | 7 Comments
Womens Carnival Day: Dates 2025, 2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017 and 2016
Info | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
That is possibly without any problems in Delphi as a well as in Lazarus. We are using the function EncodeDate for this. Here is a small example.
We have some variables for the year, the day and the month and we are using EncodeDate in order to make a date out of the values and to store the data in a TDateTime variable. After that, we are showing the new dates using ShowMessage().
2015-12-02 at 19:47