Date and Time Part 3 - TDateTimePicker component

  Рет қаралды 8,433

Mr Long Education - IT & CAT

Mr Long Education - IT & CAT

Күн бұрын

Пікірлер: 17
@AhmedShoulah
@AhmedShoulah 3 жыл бұрын
Thanks for great videos I am watching from Egypt.
@masterpilotg4
@masterpilotg4 2 жыл бұрын
How would you determine whether a year is a leap year or not and outputting it onto a label
@MrLongITandCAT
@MrLongITandCAT 2 жыл бұрын
The video (link below) shows how to determine a leap year. Does that help? kzbin.info/www/bejne/lXXLoXawe793ba8
@ALG397
@ALG397 3 жыл бұрын
Thank you very much When we click on the Tab button of the TDateTimePicker component the cursor move from the left to the right How we can do the opposite i mean when i click on the cursor it moves from the right to the left
@MrLongITandCAT
@MrLongITandCAT 3 жыл бұрын
I'm not sure what you are referring to?
@ALG397
@ALG397 3 жыл бұрын
@@MrLongITandCAT I mean insert the year first then the month and the day with tab and numbers shift the cursor with the tab button from right to left
@zahza2707
@zahza2707 2 жыл бұрын
How would you convert a birth date in the format of an ID number to a a date that can be used in calculations?
@MrLongITandCAT
@MrLongITandCAT 2 жыл бұрын
You would need to extract each element (year,month,day) and use encodedate (See previous video links in description). Example: sId := //id number in string format iYear := 2000 + StrToInt( Copy( sID, 1, 2) ) ; //assuming you dealing people born in 2000 or later iMonth := StrToInt( Copy( sID, 3, 2) ) ; iDay := StrToInt( Copy( sID, 5, 2) ) ; dBirthDate := EncodeDate( iYear, iMonth, iDay ) ; //dBirthDate is variable of type TDate
@paigeturner3977
@paigeturner3977 2 жыл бұрын
Mr Long, How do I subtract two dates from each other? If I want to get the person's age. How do I code to let it use the current date and subtract the person's date of birth to get their age, by using the year, month and day?
@MrLongITandCAT
@MrLongITandCAT 2 жыл бұрын
If you subtract TWO dates, the answer will be the number of days between those two days. So then you can divide that answer by 365 (or 365.25) to get the convert it to years. I would trunc this answer so you remove the decimal part. To get the current date you just have to use the Date function. So for example: var dBirthday : TDate ; iAge : integer ; begin dBirthday := EncodeDate( 2000, 11, 21 ) ; //this gives dBirthday a date. you can use edit controls to get each individual value for year, month and day or you can skip the encodedate option and get it from the DateTimePicker component. iAge := Trunc( (Date - dBirthday) / 365 ) ; //Hope that helps
@paigeturner3977
@paigeturner3977 2 жыл бұрын
@@MrLongITandCAT Thank you so much sir! It does help.😭😭
@paigeturner3977
@paigeturner3977 2 жыл бұрын
@@MrLongITandCAT Sir, I wrote a three hour practical today and this came in!!!! Thanks for answering in time even though you made this video almost a year ago🙏🙏
@MrLongITandCAT
@MrLongITandCAT 2 жыл бұрын
@@paigeturner3977 Happy to help 😁 and well done to you for wanting to find out. You prepared well 😀
@Thamri_Saddam_Hussein
@Thamri_Saddam_Hussein Жыл бұрын
thank u
@MoonGirl-my4zn
@MoonGirl-my4zn Жыл бұрын
You should explain the FormatDateTime
@MrLongITandCAT
@MrLongITandCAT Жыл бұрын
There is an explanation in part 1 of the Date and Time series. This video is Part 3. Part 1 and the exact part of the video can be viewed here: kzbin.info/www/bejne/hKHQmn9tr8aIrLc
@Thamri_Saddam_Hussein
@Thamri_Saddam_Hussein Жыл бұрын
how can use TDateTimePicker in Data base (Link TDateTimePicker with column type : Date)
Date and Time Part 1 - Date and Time in Delphi
14:28
Mr Long Education - IT & CAT
Рет қаралды 17 М.
Memo and Rich Edit components in Delphi
16:57
Mr Long Education - IT & CAT
Рет қаралды 19 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
Date and Time Part 2 - More Date and Time Functions and Date Calculations
12:13
Mr Long Education - IT & CAT
Рет қаралды 7 М.
Conditional Loops Part 1 - While & Repeat Loops
18:48
Mr Long Education - IT & CAT
Рет қаралды 13 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4 МЛН
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 1 МЛН
Delphi - Set Tab Stops
7:17
Delphi for Schools
Рет қаралды 2,4 М.
Text Files in Delphi - Reading from a text file example
14:55
Mr Long Education - IT & CAT
Рет қаралды 23 М.
More Delphi Basics | Part 3 | Extra MATHematical functions UPDATED
16:24
Mr Long Education - IT & CAT
Рет қаралды 3,3 М.
List Box component in Delphi
24:11
Mr Long Education - IT & CAT
Рет қаралды 12 М.
I never understood why you can't go faster than light - until now!
16:40
FloatHeadPhysics
Рет қаралды 4,7 МЛН
Editing Databases in Delphi - Editing a current record
16:22
Mr Long Education - IT & CAT
Рет қаралды 26 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН