mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 04:11:35 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			360 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			360 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example86;
 | |
| 
 | |
| { This program demonstrates the TryEncodeDateMonthWeek function }
 | |
| 
 | |
| Uses SysUtils,DateUtils;
 | |
| 
 | |
| Var
 | |
|   Y,M,Wom,Dow : Word;
 | |
|   TS : TDateTime;
 | |
| 
 | |
| Begin
 | |
|   DecodeDateMonthWeek(Now,Y,M,WoM,DoW);
 | |
|   If TryEncodeDateMonthWeek(Y,M,WoM,Dow,TS) then
 | |
|     Writeln('Today is : ',DateToStr(TS))
 | |
|   else
 | |
|     Writeln('Invalid year/month/week/dow indication');
 | |
| End. | 
