InterviewSolution
| 1. |
How do Perl programmers handle date and time operations within a Perl program? |
|
Answer» Perl is a feature-rich programming language that can easily handle dates and times within the program. Perl provides a PREDEFINED module called the DateTime module. This DateTime is a class that helps in REPRESENTING various combinations of dates and times. The DateTime module in Perl renders the New Style of the calendar by EXTENDING backward in time before its creation (in 1582). This is usually called the “proleptic Gregorian calendar”. In such a calendar, the first day of the calendar (which is also called the EPOCH) is the first day of year 1 and is believed to be the birth of Jesus Christ. The syntax is: use DateTime; Program: $datetime = localtime(); print "Local Time of the SYSTEM : $datetime\n"; |
|